feat: Show /ide subcommands based on connection status instead of ideMode boolean (#6496)

This commit is contained in:
Shreya Keshive
2025-08-19 10:24:58 -07:00
committed by GitHub
parent fde5511c27
commit 9588aa6ef9
5 changed files with 60 additions and 12 deletions

View File

@@ -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 (