diff --git a/src/main/index.ts b/src/main/index.ts index d3a1806d..4810305e 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -4,6 +4,7 @@ import { electronApp, is, optimizer } from '@electron-toolkit/utils'; import icon from '../../resources/icon.png?asset'; import { main } from './main'; import trackBounds, { getBounds, wasMaximized } from './lib/window/resizer'; +import { Router } from './lib/route-pass/Router'; @@ -30,8 +31,9 @@ async function createWindow() { trackBounds(window); - window.on('ready-to-show', () => { + window.on('ready-to-show', async () => { window.show(); + await Router.dispatch(window, "changeScene", "main"); }); // HMR for renderer base on electron-vite cli. diff --git a/src/main/main.ts b/src/main/main.ts index 00b9efbb..586b1ae1 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -37,8 +37,6 @@ export async function main(window: BrowserWindow) { await showError(window, `No songs found in folder: ${orDefault(settings.get("osuSongsDir"), "[No folder]")}. Please make sure this is the directory where you have all your songs saved.`); await configureOsuDir(window); } - - await Router.dispatch(window, "changeScene", "main"); }