6767import org .wordpress .android .models .ReaderPostDiscoverData ;
6868import org .wordpress .android .models .ReaderTag ;
6969import org .wordpress .android .models .ReaderTagType ;
70+ import org .wordpress .android .networking .ConnectionChangeReceiver ;
7071import org .wordpress .android .ui .ActionableEmptyView ;
7172import org .wordpress .android .ui .ActivityLauncher ;
7273import org .wordpress .android .ui .EmptyViewMessageType ;
@@ -1308,6 +1309,15 @@ private void updateSitesInCurrentSearch(int offset) {
13081309 mDispatcher .dispatch (ReaderActionBuilder .newReaderSearchSitesAction (payload ));
13091310 }
13101311
1312+ @ Subscribe (threadMode = ThreadMode .MAIN )
1313+ public void onEventMainThread (ConnectionChangeReceiver .ConnectionChangeEvent event ) {
1314+ if (event .isConnected ()) {
1315+ if (mCurrentSearchQuery != null ) {
1316+ submitSearchQuery (mCurrentSearchQuery );
1317+ }
1318+ }
1319+ }
1320+
13111321 private void submitSearchQuery (@ NonNull String query ) {
13121322 if (!isAdded ()) {
13131323 return ;
@@ -1317,6 +1327,10 @@ private void submitSearchQuery(@NonNull String query) {
13171327 hideSearchMessage ();
13181328 hideSearchSuggestions ();
13191329
1330+ if (!NetworkUtils .isNetworkAvailable (getContext ())) {
1331+ showEmptyView ();
1332+ }
1333+
13201334 // remember this query for future suggestions
13211335 String trimQuery = query .trim ();
13221336 ReaderSearchTable .addOrUpdateQueryString (trimQuery );
@@ -1669,6 +1683,7 @@ private void setEmptyTitleDescriptionAndButton(boolean requestFailed) {
16691683 setEmptyTitleAndDescriptionForBookmarksList ();
16701684 return ;
16711685 } else if (!NetworkUtils .isNetworkAvailable (getActivity ())) {
1686+ mIsUpdating = false ;
16721687 title = getString (R .string .reader_empty_posts_no_connection );
16731688 } else if (requestFailed ) {
16741689 if (isSearching ()) {
0 commit comments