summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.ts
diff options
context:
space:
mode:
authorBrandon Keiji <[email protected]>2025-05-13 23:55:49 +0000
committerGitHub <[email protected]>2025-05-13 16:55:49 -0700
commitd3303fd3a004ee816c2c498c2f7ffa51753afc07 (patch)
treec8764197104ed1d33c5c0efa5cb1dfc69b6df38f /packages/cli/src/ui/hooks/slashCommandProcessor.ts
parentc4c11f1d65233f31751cee65e29aa6ae3f7f2410 (diff)
refactor: move nested debugmessage and slashcommand hooks outside of useGeminiStream (#341)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 0a0a5fc5..aa7323ca 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -24,7 +24,7 @@ export const useSlashCommandProcessor = (
clearItems: UseHistoryManagerReturn['clearItems'],
refreshStatic: () => void,
setShowHelp: React.Dispatch<React.SetStateAction<boolean>>,
- setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
+ onDebugMessage: (message: string) => void,
openThemeDialog: () => void,
) => {
const slashCommands: SlashCommand[] = useMemo(
@@ -34,7 +34,7 @@ export const useSlashCommandProcessor = (
altName: '?',
description: 'for help on gemini-code',
action: (_value: PartListUnion) => {
- setDebugMessage('Opening help.');
+ onDebugMessage('Opening help.');
setShowHelp(true);
},
},
@@ -42,7 +42,7 @@ export const useSlashCommandProcessor = (
name: 'clear',
description: 'clear the screen',
action: (_value: PartListUnion) => {
- setDebugMessage('Clearing terminal.');
+ onDebugMessage('Clearing terminal.');
clearItems();
refreshStatic();
},
@@ -59,12 +59,12 @@ export const useSlashCommandProcessor = (
altName: 'exit',
description: '',
action: (_value: PartListUnion) => {
- setDebugMessage('Quitting. Good-bye.');
+ onDebugMessage('Quitting. Good-bye.');
process.exit(0);
},
},
],
- [setDebugMessage, setShowHelp, refreshStatic, openThemeDialog, clearItems],
+ [onDebugMessage, setShowHelp, refreshStatic, openThemeDialog, clearItems],
);
/**