Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit af245b1

Browse files
committed
Show messages even when offline.
Fixes #82
1 parent 9e12c14 commit af245b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)