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:
@@ -314,6 +314,7 @@
|
||||
function runBoot(appName, force) {
|
||||
const storageKey = 'lt_booted_' + (appName || 'app');
|
||||
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 pre = document.getElementById('lt-boot-text');
|
||||
if (!overlay || !pre) return;
|
||||
@@ -359,7 +360,6 @@
|
||||
overlay.style.opacity = '0';
|
||||
setTimeout(() => { overlay.style.display = 'none'; overlay.style.opacity = ''; overlay.style.transition = ''; }, 520);
|
||||
}, 500);
|
||||
sessionStorage.setItem(storageKey, '1');
|
||||
}
|
||||
}, 65);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user