diff --git a/web/src/components/Shell.jsx b/web/src/components/Shell.jsx index 4d8b8a0..6897709 100644 --- a/web/src/components/Shell.jsx +++ b/web/src/components/Shell.jsx @@ -271,9 +271,13 @@ export default function Shell({ api }) { ] }) const [activeTab, setActiveTab] = useState(() => { - if (savedTabs) { - return savedTabs[0]?.id || 1 - } + try { + const raw = localStorage.getItem(TABS_STORAGE_KEY) + if (raw) { + const parsed = JSON.parse(raw) + if (Array.isArray(parsed) && parsed.length > 0) return parsed[0]?.id || 1 + } + } catch {} return 1 }) const activeTabRef = useRef(activeTab)