fix: use translate assistant's content instead of select text (#10266)

use assistant.content instead of select text
This commit is contained in:
beyondkmp 2025-09-20 01:25:30 +08:00 committed by GitHub
parent 3d6a82fb00
commit 0697c79daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -138,8 +138,9 @@ const ActionTranslate: FC<Props> = ({ action, scrollToBottom }) => {
}
}
assistantRef.current = getDefaultTranslateAssistant(translateLang, action.selectedText)
processMessages(assistantRef.current, topicRef.current, action.selectedText, setAskId, onStream, onFinish, onError)
const assistant = getDefaultTranslateAssistant(translateLang, action.selectedText)
assistantRef.current = assistant
processMessages(assistant, topicRef.current, assistant.content, setAskId, onStream, onFinish, onError)
}, [action, targetLanguage, alterLanguage, scrollToBottom])
useEffect(() => {