Skip to content

Commit fb4c21f

Browse files
committed
fix: app not launching after update
1 parent 7fc0219 commit fb4c21f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/screens/LoginScreen/SplashScreen.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ export const SplashScreen = () => {
2121
try {
2222
setStatusText('Checking for updates...');
2323
console.log('Update check');
24+
await new Promise(r => setTimeout(r, 1000));
2425
const update = await Updates.checkForUpdateAsync();
26+
setStatusText('ok');
2527
if (update.isAvailable) {
2628
console.log('Dowload update');
2729
setStatusText('Downloading new app version...');
2830
await Updates.fetchUpdateAsync();
31+
console.log('Restarting app');
2932
setStatusText('Restarting app...');
30-
await Updates.reloadAsync();
33+
Updates.reloadAsync()
34+
.then((r) => console.log('Restart triggered', r))
35+
.catch((e) => console.error('Restarting failed', e));
3136
}
3237
} catch (e) {
3338
// Ignore error, just start with unupdated version

0 commit comments

Comments
 (0)