summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorshishu314 <[email protected]>2025-08-06 15:19:10 -0400
committerGitHub <[email protected]>2025-08-06 19:19:10 +0000
commit1f0ad865444c07481385c39b272f9ec2b94d41b9 (patch)
tree76d143c9399c16997666183c36903c95ac079e0f /packages/cli/src/ui/hooks/useGeminiStream.ts
parent6133bea388a2de69c71a6be6f1450707f2ce4dfb (diff)
fix: Restore user input when the user cancels response (#5601)
Co-authored-by: Shi Shu <[email protected]> Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 63ba961f..58bec431 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -94,6 +94,7 @@ export const useGeminiStream = (
modelSwitchedFromQuotaError: boolean,
setModelSwitchedFromQuotaError: React.Dispatch<React.SetStateAction<boolean>>,
onEditorClose: () => void,
+ onCancelSubmit: () => void,
) => {
const [initError, setInitError] = useState<string | null>(null);
const abortControllerRef = useRef<AbortController | null>(null);
@@ -200,6 +201,7 @@ export const useGeminiStream = (
Date.now(),
);
setPendingHistoryItem(null);
+ onCancelSubmit();
setIsResponding(false);
}
});