diff options
| author | AAGaming <aagaming@riseup.net> | 2024-08-03 14:07:12 -0400 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2024-08-03 14:07:12 -0400 |
| commit | d444248f62c51a261c3a2b0f8ba097d9c0ef391b (patch) | |
| tree | 3cc8bb1a3ede480b709ac1399531e9f9050520d5 /frontend | |
| parent | 9570d0b0c21fda8eb85d9fe297681633349b3803 (diff) | |
| download | decky-loader-d444248f62c51a261c3a2b0f8ba097d9c0ef391b.tar.gz decky-loader-d444248f62c51a261c3a2b0f8ba097d9c0ef391b.zip | |
hopefully fix bootloops
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/index.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 7910c740..029a731c 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -6,10 +6,22 @@ interface Window { (async () => { // Wait for main webpack chunks to definitely be loaded - console.debug('[Decky:Boot] Waiting for main Webpack chunks...'); + console.time('[Decky:Boot] Waiting for main Webpack chunks...'); while (!window.webpackChunksteamui || window.webpackChunksteamui.length < 8) { await new Promise((r) => setTimeout(r, 10)); // Can't use DFL sleep here. } + console.timeEnd('[Decky:Boot] Waiting for main Webpack chunks...'); + + // Wait for the React root to be mounted + console.time('[Decky:Boot] Waiting for React root mount...'); + let root; + while ( + !(root = document.getElementById('root')) || + !(root as any)[Object.keys(root).find((k) => k.startsWith('__reactContainer$')) as string] + ) { + await new Promise((r) => setTimeout(r, 10)); // Can't use DFL sleep here. + } + console.timeEnd('[Decky:Boot] Waiting for React root mount...'); if (!window.SP_REACT) { console.debug('[Decky:Boot] Setting up Webpack & React globals...'); |
