refactor: rename useRegisterFollowCommands to command-manager and integrate into RootProviders

This commit is contained in:
lawvs
2024-11-29 14:02:32 +08:00
parent c5854f4579
commit c7b9f39bc9
3 changed files with 7 additions and 3 deletions
-2
View File
@@ -13,7 +13,6 @@ import { applyAfterReadyCallbacks } from "./initialize/queue"
import { removeAppSkeleton } from "./lib/app"
import { appLog } from "./lib/log"
import { Titlebar } from "./modules/app/Titlebar"
import { useRegisterFollowCommands } from "./modules/command/use-register-follow-commands"
import { RootProviders } from "./providers/root-providers"
import { handlers } from "./tipc"
@@ -55,7 +54,6 @@ function App() {
const AppLayer = () => {
const appIsReady = useAppIsReady()
useRegisterFollowCommands()
useEffect(() => {
removeAppSkeleton()
@@ -9,3 +9,8 @@ export function useRegisterFollowCommands() {
useRegisterEntryCommands()
useRegisterIntegrationCommands()
}
export const FollowCommandManager = () => {
useRegisterFollowCommands()
return null
}
@@ -13,6 +13,7 @@ import { HotkeysProvider } from "react-hotkeys-hook"
import { HotKeyScopeMap } from "~/constants/hotkeys"
import { jotaiStore } from "~/lib/jotai"
import { persistConfig, queryClient } from "~/lib/query-client"
import { FollowCommandManager } from "~/modules/command/command-manager"
import { I18nProvider } from "./i18n-provider"
import { InvalidateQueryProvider } from "./invalidate-query-provider"
@@ -44,7 +45,7 @@ export const RootProviders: FC<PropsWithChildren> = ({ children }) => (
<StableRouterProvider />
<SettingSync />
<FollowCommandManager />
{import.meta.env.DEV && <Devtools />}
{children}