From ef4ca204bdce6b06072b9fb28d709742052a0c2c Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 11 Sep 2024 20:16:49 -0400 Subject: potentially fix startup race condition --- frontend/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. } -- cgit v1.2.3