Skip to content

Commit

Permalink
Merge branch 'develop' into steam-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Apr 18, 2024
2 parents 3845784 + 3baee39 commit 25be0ba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src-ui/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,23 +445,23 @@ export class AppModule {

private async logInit<T>(action: string, promise: Promise<T>): Promise<T> {
const TIMEOUT = 30000;
info(`[Init] Running ${action}`);
await info(`[Init] Running ${action}`);
try {
const result = await pTimeout<T>(
promise,
TIMEOUT,
new Error(`Initialization function ${action} timed out.`)
);
info(`[Init] '${action}' ran successfully`);
await info(`[Init] '${action}' ran successfully`);
return result;
} catch (e) {
trackEvent('app_init_error', {
await trackEvent('app_init_error', {
action,
error: `${e}`,
timeout: TIMEOUT,
metadata: `action=${action}, timeout=${TIMEOUT}, error=${e}`,
});
error(`[Init] Running '${action}' failed: ` + e);
await error(`[Init] Running '${action}' failed: ` + e);
throw e;
}
}
Expand All @@ -470,6 +470,7 @@ export class AppModule {
try {
await pMinDelay(
(async () => {
const initStartTime = Date.now();
await this.logInit(
'DeveloperDebugService initialization',
this.developerDebugService.init()
Expand Down Expand Up @@ -711,6 +712,7 @@ export class AppModule {
this.bigscreenBeyondFanAutomationService.init()
),
]);
await info(`[Init] Initialization complete! (took ${Date.now() - initStartTime}ms)`);
})(),
SPLASH_MIN_DURATION
);
Expand Down Expand Up @@ -738,7 +740,6 @@ export class AppModule {
throw e;
}
// Close the splash screen after initialization
info('[Init] Initialization complete! Closing splash screen.');
await invoke('close_splashscreen');
// Show language selection modal if user hasn't picked a language yet
const settings = await firstValueFrom(this.appSettingsService.settings);
Expand Down

0 comments on commit 25be0ba

Please sign in to comment.