mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
发送消息时也结束语音识别
This commit is contained in:
parent
e58deec255
commit
d2a8586ee2
@ -59,13 +59,15 @@ export default function VoiceInput({
|
|||||||
if (!userInput || userInput.trim() === "") {
|
if (!userInput || userInput.trim() === "") {
|
||||||
setTempUserInput("");
|
setTempUserInput("");
|
||||||
setVoiceInputText("");
|
setVoiceInputText("");
|
||||||
|
recognizer.current?.close();
|
||||||
|
recognizer.current = undefined;
|
||||||
|
setVoiceInputLoading(false);
|
||||||
} else {
|
} else {
|
||||||
if (!/\[\.\.\.\]$/.test(userInput)) {
|
if (!/\[\.\.\.\]$/.test(userInput)) {
|
||||||
setTempUserInput(userInput);
|
setTempUserInput(userInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [userInput]);
|
}, [userInput]);
|
||||||
useEffect(() => {}, [tempUserInput]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (voiceInputText.trim() !== "") {
|
if (voiceInputText.trim() !== "") {
|
||||||
|
Loading…
Reference in New Issue
Block a user