mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
修复部分问题
This commit is contained in:
parent
a86b4ba404
commit
a325ec091d
@ -138,7 +138,10 @@ class ASRService {
|
||||
// 如果有回调函数,调用一次空字符串,触发按钮状态重置
|
||||
if (this.resultCallback && typeof this.resultCallback === 'function') {
|
||||
// 使用空字符串调用回调,不会影响输入框,但可以触发按钮状态重置
|
||||
setTimeout(() => this.resultCallback(''), 100)
|
||||
const callback = this.resultCallback as (text: string, isFinal?: boolean) => void; // 明确指定类型
|
||||
setTimeout(() => {
|
||||
callback('', false);
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
} else if (data.type === 'result' && data.data) {
|
||||
@ -330,7 +333,9 @@ class ASRService {
|
||||
if (onTranscribed) {
|
||||
// 使用空字符串调用回调,不会影响输入框,但可以触发按钮状态重置
|
||||
// 传递false表示这不是最终结果,只是状态更新
|
||||
setTimeout(() => onTranscribed('', false), 100)
|
||||
setTimeout(() => {
|
||||
onTranscribed('', false);
|
||||
}, 100)
|
||||
}
|
||||
} else {
|
||||
throw new Error('WebSocket连接未就绪')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user