hopefully fix bootloops

This commit is contained in:
AAGaming
2024-08-03 14:07:12 -04:00
parent 9570d0b0c2
commit d444248f62
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -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...');