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() {
2021
2021
if (narrowedList != null ) {
2022
2022
narrowedList .onActivityResume ();
2023
2023
}
2024
- startRequests ();
2025
2024
}
2026
2025
2027
2026
@ Override
@@ -2163,7 +2162,7 @@ public enum Flag {
2163
2162
}
2164
2163
public void setupNetworkBroadcastReceiver ()
2165
2164
{
2166
- networkStateReceiver = new BroadcastReceiver () {
2165
+ networkStateReceiver = new BroadcastReceiver () {
2167
2166
final CoordinatorLayout coordinatorLayout = (CoordinatorLayout ) findViewById (R .id .coordinatorLayout );
2168
2167
@ Override
2169
2168
public void onReceive (Context context , Intent intent ) {
@@ -2172,9 +2171,13 @@ public void onReceive(Context context, Intent intent) {
2172
2171
//Remove chatBox when network connectivity is lost
2173
2172
displayChatBox (false );
2174
2173
Snackbar .make (coordinatorLayout ,R .string .no_connection ,Snackbar .LENGTH_INDEFINITE ).show ();
2174
+ //Displays old offline messages
2175
+ onReadyToDisplay (true );
2175
2176
Log .d ("Network Listener" , "No Internet" );
2176
2177
}
2177
2178
else {
2179
+ //Starts a network request only when there is an active network connection
2180
+ startRequests ();
2178
2181
Snackbar .make (coordinatorLayout ,R .string .connection_established ,Snackbar .LENGTH_SHORT ).show ();
2179
2182
Log .d ("Network Listener" , "Internet" );
2180
2183
}
You can’t perform that action at this time.
0 commit comments