From 3e4302e2e58f39d6289d95a64edbb931f3831668 Mon Sep 17 00:00:00 2001 From: virtudude Date: Sat, 25 Jul 2026 13:30:27 -0400 Subject: fix: support renamed Steam initialization API (#947) --- frontend/src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 7ef5087f..67b30d15 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -1,12 +1,21 @@ // Sets up DFL, then loads start.ts which starts up the loader +interface SteamAppInitialization { + BFinishedInitBeforeLogin?: () => boolean; + BFinishedInitStageOne?: () => boolean; +} + +const isSteamAppInitialized = () => { + const app = window.App as unknown as SteamAppInitialization | undefined; + return app?.BFinishedInitBeforeLogin?.() ?? app?.BFinishedInitStageOne?.() ?? false; +}; + (async () => { console.debug('[Decky:Boot] Frontend init'); console.time('[Decky:Boot] Waiting for SteamApp init stage 1 to finish...'); - // @ts-expect-error TODO type BFinishedInitStageOne in @decky/ui - while (!window.App?.BFinishedInitStageOne()) { + while (!isSteamAppInitialized()) { await new Promise((r) => setTimeout(r, 0)); // Can't use DFL sleep here. } -- cgit v1.2.3