summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2024-09-11 20:16:49 -0400
committerAAGaming <aagaming@riseup.net>2024-09-11 20:16:49 -0400
commitef4ca204bdce6b06072b9fb28d709742052a0c2c (patch)
treedeb26dff68317e88e3e97880c9d7202b0c7396d6 /frontend
parent1d7af36a2b275841c89815233c46cc7f105c5ddf (diff)
downloaddecky-loader-ef4ca204bdce6b06072b9fb28d709742052a0c2c.tar.gz
decky-loader-ef4ca204bdce6b06072b9fb28d709742052a0c2c.zip
potentially fix startup race condition
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index 97357b82..4a5fc7f8 100644
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -16,8 +16,10 @@ interface Window {
console.time('[Decky:Boot] Waiting for React root mount...');
let root;
while (
+ // Does React root node exist?
!(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.
}