From 6cc86b7f89f06c48891a57727f4ca6651e57c6c0 Mon Sep 17 00:00:00 2001 From: Augustin Date: Fri, 24 Apr 2026 21:36:25 +0200 Subject: [PATCH] fix(shell): resolve savedTabs undefined ReferenceError in activeTab init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush --- web/src/components/Shell.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)