Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
feat: hide splashscreen after initial startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 11, 2020
1 parent 39639af commit 92342fe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
"launchShowDuration": 3000
}
},
"cordova": {}
Expand Down
2 changes: 1 addition & 1 deletion capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
"launchShowDuration": 3000
}
},
"cordova": {}
Expand Down
2 changes: 1 addition & 1 deletion ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
"launchShowDuration": 3000
}
},
"cordova": {}
Expand Down
19 changes: 14 additions & 5 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ export class AppComponent {
initializeApp() {
this.platform.ready().then(async () => {
const url = await this.routeWatcherService.lastUrl();
if (url) {
await this.router.navigateByUrl(url);
try {
if (url) {
await this.router.navigateByUrl(url);
}
} catch (err) {
console.error(`AppComponent.initializeApp(): failed to navigate to ${url}`);
}

try {
await this.updateService.checkUpdate();
} catch (err) {
console.error('AppComponent.initializeApp(): failed to check for updates.', err);
}

SplashScreen.hide();
return this.updateService.checkUpdate().finally(() => {
return true;
});
return true;
});
}

Expand Down

0 comments on commit 92342fe

Please sign in to comment.