diff --git a/web/src/components/Shell.jsx b/web/src/components/Shell.jsx index 3556cfd..795837c 100644 --- a/web/src/components/Shell.jsx +++ b/web/src/components/Shell.jsx @@ -264,7 +264,7 @@ export default function Shell({ api }) { setTabs(prev => { const next = prev.filter(t => t.id !== tabId) - if (activeTab === tabId) { + if (activeTab === tabId && next.length > 0) { setActiveTab(next[next.length - 1].id) } return next