mirror of
https://github.com/qishibo/AnotherRedisDesktopManager.git
synced 2026-01-18 16:12:43 +00:00
fix #554 close respective tab when close connection instead of all tabs
This commit is contained in:
parent
19862c05f9
commit
20fbff6952
@ -94,7 +94,7 @@ export default {
|
||||
this.$t('message.close_to_edit_connection'),
|
||||
{ type: 'warning' },
|
||||
).then(() => {
|
||||
this.$bus.$emit('closeConnection');
|
||||
this.$bus.$emit('closeConnection', this.config.connectionName);
|
||||
this.$refs.editConnectionDialog.show();
|
||||
}).catch(() => {});
|
||||
},
|
||||
@ -103,7 +103,7 @@ export default {
|
||||
this.$t('message.close_to_connection'),
|
||||
{ type: 'warning' },
|
||||
).then(() => {
|
||||
this.$bus.$emit('closeConnection');
|
||||
this.$bus.$emit('closeConnection', this.config.connectionName);
|
||||
}).catch(() => {});
|
||||
},
|
||||
editConnectionFinished(newConfig) {
|
||||
|
||||
@ -68,6 +68,13 @@ export default {
|
||||
this.tabs = this.tabs.filter((tab) => {
|
||||
return tab.client.options.connectionName != connectionName;
|
||||
});
|
||||
|
||||
// still tabs left, solve selecting which tab
|
||||
if (this.tabs.length) {
|
||||
// previous selected left, do not change
|
||||
let filteredTab = this.tabs.filter(tab => tab.name == this.selectedTabName);
|
||||
!filteredTab.length && (this.selectedTabName = this.tabs[0].name);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user