From 9da2760a42c69f9dc9968ea2c6e4c38f59633dae Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Mon, 24 Aug 2026 18:42:34 -0400 Subject: [PATCH] A localStorage guard was covering the layout restore it wrapped --- Plugin/unraid/include/node_chat.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Plugin/unraid/include/node_chat.php b/Plugin/unraid/include/node_chat.php index 431c6ef..a8ae00f 100644 --- a/Plugin/unraid/include/node_chat.php +++ b/Plugin/unraid/include/node_chat.php @@ -724,16 +724,21 @@ function vvNcInit(prefix, meshDefault) { } // Restore the expanded state before the first paint, so the card does not visibly resize. - try { - if (localStorage.getItem('vvNcBig:' + prefix) === '1') { - _vvNcBig = true; - _vvNcApplyBig(); - // Bring the assistant along, so both halves start the session agreeing. - if (aiBtn && !aiBtn.classList.contains('vv-ai-grow-on')) { - _vvNcSyncing = true; aiBtn.click(); _vvNcSyncing = false; - } + // + // Only the storage read is guarded. The try used to wrap _vvNcApplyBig() and aiBtn.click() + // too, which meant a TypeError in either — or in any handler aiBtn.click() reaches — was + // caught here and read as "localStorage is blocked". The layout would silently fail to + // restore, with nothing in the console and no way to tell the two causes apart. + let _wantBig = false; + try { _wantBig = localStorage.getItem('vvNcBig:' + prefix) === '1'; } catch (_) {} + if (_wantBig) { + _vvNcBig = true; + _vvNcApplyBig(); + // Bring the assistant along, so both halves start the session agreeing. + if (aiBtn && !aiBtn.classList.contains('vv-ai-grow-on')) { + _vvNcSyncing = true; aiBtn.click(); _vvNcSyncing = false; } - } catch (_) {} + } vvNcMode(want); vvNcChans(); _vvNcSchedule();