This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/src/main/java/com/zulip/android/activities Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2021,7 +2021,6 @@ protected void onResume() {
20212021 if (narrowedList != null ) {
20222022 narrowedList .onActivityResume ();
20232023 }
2024- startRequests ();
20252024 }
20262025
20272026 @ Override
@@ -2163,7 +2162,7 @@ public enum Flag {
21632162 }
21642163 public void setupNetworkBroadcastReceiver ()
21652164 {
2166- networkStateReceiver = new BroadcastReceiver () {
2165+ networkStateReceiver = new BroadcastReceiver () {
21672166 final CoordinatorLayout coordinatorLayout = (CoordinatorLayout ) findViewById (R .id .coordinatorLayout );
21682167 @ Override
21692168 public void onReceive (Context context , Intent intent ) {
@@ -2172,9 +2171,13 @@ public void onReceive(Context context, Intent intent) {
21722171 //Remove chatBox when network connectivity is lost
21732172 displayChatBox (false );
21742173 Snackbar .make (coordinatorLayout ,R .string .no_connection ,Snackbar .LENGTH_INDEFINITE ).show ();
2174+ //Displays old offline messages
2175+ onReadyToDisplay (true );
21752176 Log .d ("Network Listener" , "No Internet" );
21762177 }
21772178 else {
2179+ //Starts a network request only when there is an active network connection
2180+ startRequests ();
21782181 Snackbar .make (coordinatorLayout ,R .string .connection_established ,Snackbar .LENGTH_SHORT ).show ();
21792182 Log .d ("Network Listener" , "Internet" );
21802183 }
You can’t perform that action at this time.
0 commit comments