fix: guard against empty tabs array in closeTab
All checks were successful
Beta Release / beta (push) Successful in 37s
All checks were successful
Beta Release / beta (push) Successful in 37s
💾 Generated with Crush Assisted-by: GLM-5-Turbo via Crush <crush@charm.land>
This commit is contained in:
@@ -264,7 +264,7 @@ export default function Shell({ api }) {
|
|||||||
|
|
||||||
setTabs(prev => {
|
setTabs(prev => {
|
||||||
const next = prev.filter(t => t.id !== tabId)
|
const next = prev.filter(t => t.id !== tabId)
|
||||||
if (activeTab === tabId) {
|
if (activeTab === tabId && next.length > 0) {
|
||||||
setActiveTab(next[next.length - 1].id)
|
setActiveTab(next[next.length - 1].id)
|
||||||
}
|
}
|
||||||
return next
|
return next
|
||||||
|
|||||||
Reference in New Issue
Block a user