diff options
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java index 452de5940..df74bfcd7 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayStatusFragment.java @@ -97,7 +97,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn private String instanceType; private String search_peertube, remote_channel_name; private String bookmark; - private boolean isConnectedToInternet; public DisplayStatusFragment(){ } @@ -114,7 +113,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn firstTootsLoaded = true; showPinned = false; showReply = false; - isConnectedToInternet = true; if (bundle != null) { type = (RetrieveFeedsAsyncTask.Type) bundle.get("type"); targetedId = bundle.getString("targetedId", null); @@ -197,8 +195,11 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn else asyncTask = new RetrievePeertubeSearchAsyncTask(context, remoteInstance, search_peertube, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); }else{ - if( type == RetrieveFeedsAsyncTask.Type.HOME && !isConnectedToInternet){ - asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + if( type == RetrieveFeedsAsyncTask.Type.HOME){ + if( Helper.isConnectedToInternet(context, Helper.getLiveInstance(context))) + asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + else + asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, true,DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); }else { asyncTask = new RetrieveFeedsAsyncTask(context, type, max_id, DisplayStatusFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } @@ -582,7 +583,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn retrieveMissingToots(statuses.get(0).getId()); } }else if (type == RetrieveFeedsAsyncTask.Type.HOME){ - isConnectedToInternet = Helper.isConnectedToInternet(context, Helper.getLiveInstance(context)); statusListAdapter.updateMuted(mutedAccount); if( statuses != null && statuses.size() > 0) retrieveMissingToots(statuses.get(0).getId()); |