← Commit history

Defer the rescue so it cannot race the bundle into a second render loop

John Lauer ·8a776af250 ·2mo ago ·parent e60830b
1 file changed +5−1
viewer/index.html+5−1
@@ -1647,7 +1647,11 @@ async function loadCurrentGlb(force) {       cam.setPosition(new B.Vector3(ctr[0] + r * 0.55, ctr[1] - r * 0.62, ctr[2] + r * 0.55));       cam.setTarget(new B.Vector3(ctr[0], ctr[1], ctr[2]));     }-    for (const ms of [80, 400, 1200, 2500, 5000]) setTimeout(sandboxRenderRescue, ms);+    // Last resort only. With the storage shim in place the bundle does all of+    // this itself (its own light + spotLight, the .env IBL, its own render+    // loop, its own framing), so these fire late and find nothing to do.+    // Running early would race the bundle and start a SECOND render loop.+    for (const ms of [7000, 15000]) setTimeout(sandboxRenderRescue, ms);      // BULLETPROOF enforcement — the viewer's goHome()/frameModel()/setView()     // re-init the EnvironmentHelper and reset the ground alpha back to 1