From e7232c0d29ef67cc8d88b75d4f85b135d9a37611 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Date: Tue, 31 Mar 2026 22:58:34 -0700 Subject: [PATCH] fix: rename shadowed isMobile in renderLeft to avoid TDZ crash The outer IIFE declares const isMobile (line 27, from #340) and renderLeft() declares its own const isMobile (line 821, pre-existing). JavaScript hoists const declarations within the function scope, so referencing isMobile at line 574 (inside renderLeft but before line 821) throws 'Cannot access isMobile before initialization'. Rename the inner declaration to isNarrow since it uses a different breakpoint (640px for column hiding vs 1024px for packet limit). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- public/index.html | 56 +++++++++++++++++++++++------------------------ public/packets.js | 4 ++-- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/public/index.html b/public/index.html index eefbfa85..8dbfc26a 100644 --- a/public/index.html +++ b/public/index.html @@ -22,9 +22,9 @@ - - - + + + @@ -81,30 +81,30 @@
- - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/packets.js b/public/packets.js index 2fa45354..072f56f9 100644 --- a/public/packets.js +++ b/public/packets.js @@ -818,8 +818,8 @@ { key: 'rpt', label: 'Rpt' }, { key: 'details', label: 'Details' }, ]; - const isMobile = window.innerWidth <= 640; - const defaultHidden = isMobile ? ['region', 'hash', 'observer', 'path', 'rpt', 'size'] : ['region']; + const isNarrow = window.innerWidth <= 640; + const defaultHidden = isNarrow ? ['region', 'hash', 'observer', 'path', 'rpt', 'size'] : ['region']; let visibleCols; try { visibleCols = JSON.parse(localStorage.getItem('packets-visible-cols'));