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.
|
// Restore the expanded state before the first paint, so the card does not visibly resize.
|
||||||
try {
|
//
|
||||||
if (localStorage.getItem('vvNcBig:' + prefix) === '1') {
|
// Only the storage read is guarded. The try used to wrap _vvNcApplyBig() and aiBtn.click()
|
||||||
_vvNcBig = true;
|
// too, which meant a TypeError in either — or in any handler aiBtn.click() reaches — was
|
||||||
_vvNcApplyBig();
|
// caught here and read as "localStorage is blocked". The layout would silently fail to
|
||||||
// Bring the assistant along, so both halves start the session agreeing.
|
// restore, with nothing in the console and no way to tell the two causes apart.
|
||||||
if (aiBtn && !aiBtn.classList.contains('vv-ai-grow-on')) {
|
let _wantBig = false;
|
||||||
_vvNcSyncing = true; aiBtn.click(); _vvNcSyncing = 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);
|
vvNcMode(want);
|
||||||
vvNcChans();
|
vvNcChans();
|
||||||
_vvNcSchedule();
|
_vvNcSchedule();
|
||||||
|
|||||||
Reference in New Issue
Block a user