diff options
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/slashCommandProcessor.ts | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index d1af9964..4e70eab7 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -206,7 +206,22 @@ export const useSlashCommandProcessor = ( ], ); - const ideMode = config?.getIdeMode(); + useEffect(() => { + if (!config) { + return; + } + + const ideClient = config.getIdeClient(); + const listener = () => { + reloadCommands(); + }; + + ideClient.addStatusChangeListener(listener); + + return () => { + ideClient.removeStatusChangeListener(listener); + }; + }, [config, reloadCommands]); useEffect(() => { const controller = new AbortController(); @@ -228,7 +243,7 @@ export const useSlashCommandProcessor = ( return () => { controller.abort(); }; - }, [config, ideMode, reloadTrigger]); + }, [config, reloadTrigger]); const handleSlashCommand = useCallback( async ( |
