mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
add new tab only if was not already opened
This commit is contained in:
@@ -70,11 +70,13 @@ export default new Vuex.Store({
|
||||
state.dbName = name
|
||||
},
|
||||
addTab (state, tab) {
|
||||
// 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 }) {
|
||||
const tab = state.tabs[index]
|
||||
|
||||
Reference in New Issue
Block a user