Fix dictation readiness after app refresh

This commit is contained in:
Mohamed Boudra
2026-04-20 17:23:17 +07:00
parent ac45f23213
commit 93095aa1d2
5 changed files with 187 additions and 12 deletions
@@ -480,11 +480,15 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
toast.error(dictationUnavailableMessage);
return;
}
if (!canStartDictation()) {
isDictatingRef.current = false;
return;
}
// Keep hotkey toggling deterministic between the async start call and the
// state-ref sync effect, so a rapid second toggle routes to confirm.
isDictatingRef.current = true;
await startDictation();
}, [dictationUnavailableMessage, startDictation, toast]);
}, [canStartDictation, dictationUnavailableMessage, startDictation, toast]);
// Animate overlay
useEffect(() => {