1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

Update currentTab when close tabs #112

This commit is contained in:
lana-k
2023-07-03 23:13:09 +02:00
parent 41e0ae7332
commit 6982204e68
2 changed files with 15 additions and 5 deletions

View File

@@ -36,9 +36,11 @@ export default {
state.currentTabId = state.tabs[index - 1].id
} else {
state.currentTabId = null
state.currentTab = null
state.untitledLastIndex = 0
}
state.currentTab = state.currentTabId
? state.tabs.find(tab => tab.id === state.currentTabId)
: null
}
state.tabs.splice(index, 1)
},