A localStorage guard was covering the layout restore it wrapped
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user