mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
fix: Restore user input when the user cancels response (#5601)
Co-authored-by: Shi Shu <shii@google.com> Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
parent
6133bea388
commit
1f0ad86544
3 changed files with 87 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue