File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,7 @@ const openConnection = async (name) => {
295295 tabStore .upsertTab ({
296296 server: name,
297297 db: browserStore .getSelectedDB (name),
298+ forceSwitch: true ,
298299 })
299300 }
300301 } catch (e) {
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ const useTabStore = defineStore('tab', {
161161 * @param {boolean } [clearValue]
162162 * @param {string } format
163163 * @param {string } decode
164+ * @param {boolean } forceSwitch
164165 * @param {* } [value]
165166 */
166167 upsertTab ( {
@@ -177,6 +178,7 @@ const useTabStore = defineStore('tab', {
177178 clearValue,
178179 format = '' ,
179180 decode = '' ,
181+ forceSwitch = false ,
180182 } ) {
181183 let tabIndex = findIndex ( this . tabList , { name : server } )
182184 if ( tabIndex === - 1 ) {
@@ -221,6 +223,9 @@ const useTabStore = defineStore('tab', {
221223 if ( clearValue === true ) {
222224 tab . value = undefined
223225 }
226+ if ( forceSwitch === true ) {
227+ this . _setActivatedIndex ( tabIndex , true , subTab )
228+ }
224229 }
225230 } ,
226231
You can’t perform that action at this time.
0 commit comments