mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-04-22 22:08:04 +08:00
fix: can not switch to an open connection from connection tree view
This commit is contained in:
parent
6e44c64441
commit
edd77182a5
@ -295,6 +295,7 @@ const openConnection = async (name) => {
|
||||
tabStore.upsertTab({
|
||||
server: name,
|
||||
db: browserStore.getSelectedDB(name),
|
||||
forceSwitch: true,
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -161,6 +161,7 @@ const useTabStore = defineStore('tab', {
|
||||
* @param {boolean} [clearValue]
|
||||
* @param {string} format
|
||||
* @param {string} decode
|
||||
* @param {boolean} forceSwitch
|
||||
* @param {*} [value]
|
||||
*/
|
||||
upsertTab({
|
||||
@ -177,6 +178,7 @@ const useTabStore = defineStore('tab', {
|
||||
clearValue,
|
||||
format = '',
|
||||
decode = '',
|
||||
forceSwitch = false,
|
||||
}) {
|
||||
let tabIndex = findIndex(this.tabList, { name: server })
|
||||
if (tabIndex === -1) {
|
||||
@ -221,6 +223,9 @@ const useTabStore = defineStore('tab', {
|
||||
if (clearValue === true) {
|
||||
tab.value = undefined
|
||||
}
|
||||
if (forceSwitch === true) {
|
||||
this._setActivatedIndex(tabIndex, true, subTab)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user