[Refactor] Extract command definitions to coreCommandHooks (#1785)

* [Refactor] Extract command definitions to coreCommandHooks

* Register core commands

* Fix rebase issue
This commit is contained in:
Chenlei Hu
2024-12-03 20:06:19 -08:00
committed by GitHub
parent e893f3ed03
commit dabcd4741b
3 changed files with 489 additions and 475 deletions

View File

@@ -40,6 +40,8 @@ import { useModelStore } from '@/stores/modelStore'
import { useServerConfigStore } from '@/stores/serverConfigStore'
import { SERVER_CONFIG_ITEMS } from '@/constants/serverConfig'
import { useMenuItemStore } from '@/stores/menuItemStore'
import { useCommandStore } from '@/stores/commandStore'
import { useCoreCommands } from '@/hooks/coreCommandHooks'
setupAutoQueueHandler()
@@ -105,6 +107,8 @@ watchEffect(() => {
const init = () => {
settingStore.addSettings(app.ui.settings)
const coreCommands = useCoreCommands()
useCommandStore().registerCommands(coreCommands)
useMenuItemStore().registerCoreMenuCommands()
useKeybindingStore().loadCoreKeybindings()
useSidebarTabStore().registerCoreSidebarTabs()