fix: boot sequence lines appearing twice

Two init paths both called runBoot() before sessionStorage was set
(the key was only written on completion, ~1.1s later):
- Private init() at DOMContentLoaded → runBoot()
- lt.init() HTML call on DOMContentLoaded → ltInit() → runBoot()

Both found no session key and started simultaneous setInterval loops
on the same <pre>, each appending the same message → every line twice.

Fix: set the sessionStorage key immediately at the start of runBoot()
so any concurrent second call exits early.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-27 14:12:05 -04:00
parent 45b968b77d
commit 7630da8abd
+1 -1
View File
@@ -314,6 +314,7 @@
function runBoot(appName, force) { function runBoot(appName, force) {
const storageKey = 'lt_booted_' + (appName || 'app'); const storageKey = 'lt_booted_' + (appName || 'app');
if (!force && sessionStorage.getItem(storageKey)) return; if (!force && sessionStorage.getItem(storageKey)) return;
sessionStorage.setItem(storageKey, '1'); // Claim the run immediately to block double-init
const overlay = document.getElementById('lt-boot'); const overlay = document.getElementById('lt-boot');
const pre = document.getElementById('lt-boot-text'); const pre = document.getElementById('lt-boot-text');
if (!overlay || !pre) return; if (!overlay || !pre) return;
@@ -359,7 +360,6 @@
overlay.style.opacity = '0'; overlay.style.opacity = '0';
setTimeout(() => { overlay.style.display = 'none'; overlay.style.opacity = ''; overlay.style.transition = ''; }, 520); setTimeout(() => { overlay.style.display = 'none'; overlay.style.opacity = ''; overlay.style.transition = ''; }, 520);
}, 500); }, 500);
sessionStorage.setItem(storageKey, '1');
} }
}, 65); }, 65);
} }