diff --git a/src/components/ConnectionMenu.vue b/src/components/ConnectionMenu.vue index ea3e7fb..cf83757 100644 --- a/src/components/ConnectionMenu.vue +++ b/src/components/ConnectionMenu.vue @@ -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) { diff --git a/src/components/Tabs.vue b/src/components/Tabs.vue index dcd7c40..175f5bd 100644 --- a/src/components/Tabs.vue +++ b/src/components/Tabs.vue @@ -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: {