mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 10:08:52 +08:00
add new tab only if was not already opened
This commit is contained in:
@@ -70,10 +70,12 @@ export default new Vuex.Store({
|
||||
state.dbName = name
|
||||
},
|
||||
addTab (state, tab) {
|
||||
state.tabs.push(tab)
|
||||
|
||||
if (!tab.name) {
|
||||
state.untitledLastIndex += 1
|
||||
// add new tab only if was not already opened
|
||||
if (!state.tabs.some(openedTab => openedTab.id === tab.id)) {
|
||||
state.tabs.push(tab)
|
||||
if (!tab.name) {
|
||||
state.untitledLastIndex += 1
|
||||
}
|
||||
}
|
||||
},
|
||||
updateTab (state, { index, name, id, query, chart, isUnsaved }) {
|
||||
|
||||
Reference in New Issue
Block a user