From 7630da8abdca5a8ccf6e12749885e927b10100d2 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 27 Mar 2026 14:12:05 -0400 Subject: [PATCH] fix: boot sequence lines appearing twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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
, 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 
---
 base.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base.js b/base.js
index 8ecb0ec..0799c22 100644
--- a/base.js
+++ b/base.js
@@ -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);
   }