Skip to content

Commit 98d081f

Browse files
committed
store [nfc]: Pull out _clearReportingErrorsToUser from poll method
This logic pairs closely with _maybeReportToUserTransientError, so pulling it out lets that logic live nearer each other.
1 parent d52dedd commit 98d081f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/model/store.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,7 @@ class UpdateMachine {
10941094
backoffMachine = null;
10951095

10961096
store.isLoading = false;
1097-
// Dismiss existing errors, if any.
1098-
reportErrorToUserBriefly(null);
1099-
_accumulatedTransientFailureCount = 0;
1097+
_clearReportingErrorsToUser();
11001098

11011099
final events = result.events;
11021100
for (final event in events) {
@@ -1182,6 +1180,11 @@ class UpdateMachine {
11821180

11831181
int _accumulatedTransientFailureCount = 0;
11841182

1183+
void _clearReportingErrorsToUser() {
1184+
_accumulatedTransientFailureCount = 0;
1185+
reportErrorToUserBriefly(null);
1186+
}
1187+
11851188
/// This only reports transient errors after reaching
11861189
/// a pre-defined threshold of retries.
11871190
void _maybeReportToUserTransientError(Object error) {

0 commit comments

Comments
 (0)