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

Commit

Permalink
stricter conditions to block progress in onboarding, do not allow fet…
Browse files Browse the repository at this point in the history
…ch timed out to proceed. longer duration until considered timed out
  • Loading branch information
mlim15 committed Jan 17, 2021
1 parent 6bafc46 commit 19c91e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/UI-onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class OnboardingScreenState extends State<OnboardingScreen> {
try {
// TODO if I make the forecast screen a little more flexible
// the entire onboarding page here can be removed
if (await update.completeUpdate(true, true) != update.CompletionStatus.failure) {
update.CompletionStatus _result = await update.completeUpdate(true, true);
if (_result == update.CompletionStatus.success || _result == update.CompletionStatus.unnecessary) {
doNotProceed = false;
}
} catch(e) {
Expand Down
6 changes: 3 additions & 3 deletions lib/support-update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ Future<CompletionStatus> completeUpdate(bool forceRefresh, bool silent, {BuildCo
// TODO verify this awaits in order like the for loop used to
imagery.nowcasts.forEach((nowcast) async {await nowcast.refresh(forceRefresh);});
}
Duration interval = const Duration(milliseconds: 1000);
Duration interval = const Duration(milliseconds: 1000);
int counter = 0;
int maxTries = 10;
int maxTries = 15;
// All the garbage we use to determine when the job is actually done
// and give feedback to the user.
while(true) {
// Every 500 ms proceed to check to see if any ending condition is true.
// Every ${interval} proceed to check to see if any ending condition is true.
await Future.delayed(interval);
// Check to see if we have exceeded the max waiting time.
if (counter >= maxTries) {
Expand Down

0 comments on commit 19c91e9

Please sign in to comment.