mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 08:12:03 +00:00
potentially fix startup race condition
This commit is contained in:
@@ -16,8 +16,10 @@ interface Window {
|
|||||||
console.time('[Decky:Boot] Waiting for React root mount...');
|
console.time('[Decky:Boot] Waiting for React root mount...');
|
||||||
let root;
|
let root;
|
||||||
while (
|
while (
|
||||||
|
// Does React root node exist?
|
||||||
!(root = document.getElementById('root')) ||
|
!(root = document.getElementById('root')) ||
|
||||||
!(root as any)[Object.keys(root).find((k) => k.startsWith('__reactContainer$')) as string]
|
// Does it have a child element?
|
||||||
|
!(root as any)[Object.keys(root).find((k) => k.startsWith('__reactContainer$')) as string].child
|
||||||
) {
|
) {
|
||||||
await new Promise((r) => setTimeout(r, 10)); // Can't use DFL sleep here.
|
await new Promise((r) => setTimeout(r, 10)); // Can't use DFL sleep here.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user