summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/index.ts13
1 files changed, 11 insertions, 2 deletions
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.
}