diff --git a/src/stores/workspace/sidebarTabStore.ts b/src/stores/workspace/sidebarTabStore.ts index 2f5bb7a225..263aea2434 100644 --- a/src/stores/workspace/sidebarTabStore.ts +++ b/src/stores/workspace/sidebarTabStore.ts @@ -5,6 +5,7 @@ import { useWorkflowsSidebarTab } from '@/hooks/sidebarTabs/workflowsSidebarTab' import { SidebarTabExtension } from '@/types/extensionTypes' import { defineStore } from 'pinia' import { computed, ref } from 'vue' +import { useCommandStore } from '../commandStore' export const useSidebarTabStore = defineStore('sidebarTab', () => { const sidebarTabs = ref([]) @@ -23,6 +24,16 @@ export const useSidebarTabStore = defineStore('sidebarTab', () => { const registerSidebarTab = (tab: SidebarTabExtension) => { sidebarTabs.value = [...sidebarTabs.value, tab] + useCommandStore().registerCommand({ + id: `Workspace.ToggleSidebarTab.${tab.id}`, + icon: tab.icon, + label: tab.tooltip, + tooltip: tab.tooltip, + versionAdded: '1.3.9', + function: () => { + toggleSidebarTab(tab.id) + } + }) } const unregisterSidebarTab = (id: string) => { diff --git a/src/stores/workspaceStateStore.ts b/src/stores/workspaceStateStore.ts index 483ca71325..07127fd5dd 100644 --- a/src/stores/workspaceStateStore.ts +++ b/src/stores/workspaceStateStore.ts @@ -35,16 +35,6 @@ export const useWorkspaceStore = defineStore('workspace', { actions: { registerSidebarTab(tab: SidebarTabExtension) { this.sidebarTab.registerSidebarTab(tab) - useCommandStore().registerCommand({ - id: `Workspace.ToggleSidebarTab.${tab.id}`, - icon: tab.icon, - label: tab.tooltip, - tooltip: tab.tooltip, - versionAdded: '1.3.9', - function: () => { - this.sidebarTab.toggleSidebarTab(tab.id) - } - }) }, unregisterSidebarTab(id: string) { this.sidebarTab.unregisterSidebarTab(id)