diff --git a/src/renderer/components/WorkspaceQueryTab.vue b/src/renderer/components/WorkspaceQueryTab.vue index 20947f6b..8dfee150 100644 --- a/src/renderer/components/WorkspaceQueryTab.vue +++ b/src/renderer/components/WorkspaceQueryTab.vue @@ -17,7 +17,7 @@ class="btn btn-primary btn-sm" :class="{'loading':isQuering}" :disabled="!query" - title="F9" + title="F5" @click="runQuery(query)" > {{ $t('word.run') }} @@ -89,10 +89,14 @@ export default { }, computed: { ...mapGetters({ - getWorkspace: 'workspaces/getWorkspace' + getWorkspace: 'workspaces/getWorkspace', + selectedWorkspace: 'workspaces/getSelected' }), workspace () { return this.getWorkspace(this.connection.uid); + }, + isWorkspaceSelected () { + return this.workspace.uid === this.selectedWorkspace; } }, created () { @@ -169,9 +173,9 @@ export default { this.$refs.queryEditor.editor.resize(); }, onKey (e) { - if (this.isSelected) { + if (this.isSelected && this.isWorkspaceSelected) { e.stopPropagation(); - if (e.key === 'F9') + if (e.key === 'F5') this.runQuery(this.query); } } diff --git a/src/renderer/components/WorkspaceTableTab.vue b/src/renderer/components/WorkspaceTableTab.vue index 083b6527..2bc05c71 100644 --- a/src/renderer/components/WorkspaceTableTab.vue +++ b/src/renderer/components/WorkspaceTableTab.vue @@ -142,13 +142,14 @@ export default { }, computed: { ...mapGetters({ - getWorkspace: 'workspaces/getWorkspace' + getWorkspace: 'workspaces/getWorkspace', + selectedWorkspace: 'workspaces/getSelected' }), workspace () { return this.getWorkspace(this.connection.uid); }, isSelected () { - return this.workspace.selected_tab === 'data'; + return this.workspace.selected_tab === 'data' && this.workspace.uid === this.selectedWorkspace; }, isTable () { return !!this.workspace.breadcrumbs.table;