mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: Show /ide subcommands based on connection status instead of ideMode boolean (#6496)
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user