@@ -1029,8 +1029,6 @@ class UpdateMachine {
1029
1029
if (_disposed) return ;
1030
1030
} catch (e) {
1031
1031
if (_disposed) return ;
1032
- store.isLoading = true ;
1033
-
1034
1032
final shouldRetry = _triagePollRequestError (e);
1035
1033
if (! shouldRetry) rethrow ;
1036
1034
await (backoffMachine ?? = BackoffMachine ()).wait ();
@@ -1056,7 +1054,6 @@ class UpdateMachine {
1056
1054
// and failures, the successes themselves should space out the requests.
1057
1055
backoffMachine = null ;
1058
1056
1059
- store.isLoading = false ;
1060
1057
_clearReportingErrorsToUser ();
1061
1058
1062
1059
final events = result.events;
@@ -1083,7 +1080,6 @@ class UpdateMachine {
1083
1080
// or an unexpected exception representing a bug in our code or the server.
1084
1081
// Either way, the show must go on. So reload server data from scratch.
1085
1082
1086
- store.isLoading = true ;
1087
1083
final isUnexpected = _triagePollError (e);
1088
1084
1089
1085
if (isUnexpected) {
@@ -1110,6 +1106,7 @@ class UpdateMachine {
1110
1106
int _accumulatedTransientFailureCount = 0 ;
1111
1107
1112
1108
void _clearReportingErrorsToUser () {
1109
+ store.isLoading = false ;
1113
1110
_accumulatedTransientFailureCount = 0 ;
1114
1111
reportErrorToUserBriefly (null );
1115
1112
}
@@ -1120,6 +1117,8 @@ class UpdateMachine {
1120
1117
/// after reporting the error if appropriate to the user and/or developer.
1121
1118
/// Otherwise, this method returns false with no side effects.
1122
1119
bool _triagePollRequestError (Object error) {
1120
+ store.isLoading = true ;
1121
+
1123
1122
if (error is ! ApiRequestException ) {
1124
1123
// Some unexpected error, outside even making the HTTP request.
1125
1124
// Definitely a bug in our code.
@@ -1167,6 +1166,8 @@ class UpdateMachine {
1167
1166
/// Reports the error if appropriate to the user and/or developer;
1168
1167
/// then returns true just if the error was unexpected.
1169
1168
bool _triagePollError (Object error) {
1169
+ store.isLoading = true ;
1170
+
1170
1171
bool isUnexpected;
1171
1172
switch (error) {
1172
1173
case ZulipApiException (code: 'BAD_EVENT_QUEUE_ID' ):
0 commit comments