Skip to content

Commit

Permalink
fix: app now retries a couple of times if offline
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Apr 17, 2023
1 parent b0a7f01 commit b7600cc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/windows/main/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
if (!selectedUser) selectedUser = Object.values(sUsers).find((user) => user.id32 == $activeUserId.toString())?.PersonaName;
});
await AppController.setup();
if (navigator.onLine) {
$isOnline = true;
} else {
const wantsToContinue = await AppController.promptOffline();
let i = 0;
while(!$isOnline && i < 4) {
if (navigator.onLine) $isOnline = true;
}
await AppController.setup();
if (!$isOnline) {
const wantsToContinue = await AppController.promptOffline();
if (!wantsToContinue) exit(0);
}
}
AppController.init();
});
Expand Down

0 comments on commit b7600cc

Please sign in to comment.