diff --git a/src/renderer/components/Workspace.vue b/src/renderer/components/Workspace.vue index 4f6a5e1d..1cc20549 100644 --- a/src/renderer/components/Workspace.vue +++ b/src/renderer/components/Workspace.vue @@ -24,7 +24,11 @@ @mousedown.left="selectTab({uid: workspace.uid, tab: tab.uid})" @mouseup.middle="closeTab(tab)" > - + {{ tab.content || 'Query' | cutText }} #{{ tab.index }} diff --git a/src/renderer/components/WorkspaceTabQuery.vue b/src/renderer/components/WorkspaceTabQuery.vue index 5e64aa33..b16fc82f 100644 --- a/src/renderer/components/WorkspaceTabQuery.vue +++ b/src/renderer/components/WorkspaceTabQuery.vue @@ -238,6 +238,9 @@ export default { workspace () { return this.getWorkspace(this.connection.uid); }, + tabUid () { + return this.$vnode.key; + }, breadcrumbsSchema () { return this.workspace.breadcrumbs.schema || null; }, @@ -306,6 +309,7 @@ export default { addNotification: 'notifications/addNotification', changeBreadcrumbs: 'workspaces/changeBreadcrumbs', updateTabContent: 'workspaces/updateTabContent', + setUnsavedChanges: 'workspaces/setUnsavedChanges', saveHistory: 'history/saveHistory' }), async runQuery (query) { @@ -344,6 +348,8 @@ export default { content: query }); this.saveHistory(params); + if (!this.autocommit) + this.setUnsavedChanges({ uid: this.connection.uid, tUid: this.tabUid, isChanged: true }); } else this.addNotification({ status: 'error', message: response }); @@ -451,6 +457,7 @@ export default { }; await Schema.commitTab(params); + this.setUnsavedChanges({ uid: this.connection.uid, tUid: this.tabUid, isChanged: false }); this.addNotification({ status: 'success', message: this.$t('message.actionSuccessful', { action: 'COMMIT' }) }); } catch (err) { @@ -468,6 +475,7 @@ export default { }; await Schema.rollbackTab(params); + this.setUnsavedChanges({ uid: this.connection.uid, tUid: this.tabUid, isChanged: false }); this.addNotification({ status: 'success', message: this.$t('message.actionSuccessful', { action: 'ROLLBACK' }) }); } catch (err) {