diff --git a/src/main/events/library/open-game.ts b/src/main/events/library/open-game.ts index 5bfd6433..d1d845f0 100644 --- a/src/main/events/library/open-game.ts +++ b/src/main/events/library/open-game.ts @@ -30,7 +30,9 @@ const openGame = async ( }); // Always show the launcher window when launching a game - WindowManager.createGameLauncherWindow(shop, objectId); + await WindowManager.createGameLauncherWindow(shop, objectId); + + await new Promise((resolve) => setTimeout(resolve, 2000)); if (parsedParams.length === 0) { shell.openPath(parsedPath); diff --git a/src/main/index.ts b/src/main/index.ts index f712b7a5..61f8051c 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -188,6 +188,8 @@ const handleRunGame = async (shop: GameShop, objectId: string) => { WindowManager.createMainWindow(); } + await new Promise((resolve) => setTimeout(resolve, 2000)); + const parsedPath = parseExecutablePath(game.executablePath); const parsedParams = parseLaunchOptions(game.launchOptions); diff --git a/src/renderer/src/pages/game-launcher/game-launcher.tsx b/src/renderer/src/pages/game-launcher/game-launcher.tsx index b6ce2ffd..3d22cfff 100644 --- a/src/renderer/src/pages/game-launcher/game-launcher.tsx +++ b/src/renderer/src/pages/game-launcher/game-launcher.tsx @@ -52,7 +52,6 @@ export default function GameLauncher() { } }, [shop, objectId]); - // Fallback auto-close timer - game detection will usually close it sooner useEffect(() => { if (!windowShown) return; @@ -91,19 +90,16 @@ export default function GameLauncher() { } }, []); - // Extract color as soon as we have the image URL useEffect(() => { if (coverImage && !colorExtracted) { extractAccentColor(coverImage); } }, [coverImage, colorExtracted, extractAccentColor]); - // Only show content when both image is loaded and color is extracted successfully const isReady = imageLoaded && colorExtracted && !colorError; const hasFailed = imageError || colorError || (!coverImage && gameAssets !== null); - // Show or close window based on loading state useEffect(() => { if (windowShown) return;