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

Commit 19c91e9

Browse files
committed
stricter conditions to block progress in onboarding, do not allow fetch timed out to proceed. longer duration until considered timed out
1 parent 6bafc46 commit 19c91e9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/UI-onboarding.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class OnboardingScreenState extends State<OnboardingScreen> {
7979
try {
8080
// TODO if I make the forecast screen a little more flexible
8181
// the entire onboarding page here can be removed
82-
if (await update.completeUpdate(true, true) != update.CompletionStatus.failure) {
82+
update.CompletionStatus _result = await update.completeUpdate(true, true);
83+
if (_result == update.CompletionStatus.success || _result == update.CompletionStatus.unnecessary) {
8384
doNotProceed = false;
8485
}
8586
} catch(e) {

lib/support-update.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ Future<CompletionStatus> completeUpdate(bool forceRefresh, bool silent, {BuildCo
109109
// TODO verify this awaits in order like the for loop used to
110110
imagery.nowcasts.forEach((nowcast) async {await nowcast.refresh(forceRefresh);});
111111
}
112-
Duration interval = const Duration(milliseconds: 1000);
112+
Duration interval = const Duration(milliseconds: 1000);
113113
int counter = 0;
114-
int maxTries = 10;
114+
int maxTries = 15;
115115
// All the garbage we use to determine when the job is actually done
116116
// and give feedback to the user.
117117
while(true) {
118-
// Every 500 ms proceed to check to see if any ending condition is true.
118+
// Every ${interval} proceed to check to see if any ending condition is true.
119119
await Future.delayed(interval);
120120
// Check to see if we have exceeded the max waiting time.
121121
if (counter >= maxTries) {

0 commit comments

Comments
 (0)