fix(core) Fix not resetting when after first get out of completion suggestions (#5635)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Sandy Tao 2025-08-05 17:37:44 -07:00 committed by GitHub
parent 02f7e48c51
commit 59bde4a612
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -127,6 +127,13 @@ export function useAtCompletion(props: UseAtCompletionProps): void {
// Reacts to user input (`pattern`) ONLY. // Reacts to user input (`pattern`) ONLY.
useEffect(() => { useEffect(() => {
if (!enabled) { if (!enabled) {
// reset when first getting out of completion suggestions
if (
state.status === AtCompletionStatus.READY ||
state.status === AtCompletionStatus.ERROR
) {
dispatch({ type: 'RESET' });
}
return; return;
} }
if (pattern === null) { if (pattern === null) {