mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
Update TextChat.jsx
This commit is contained in:
parent
b49024f1f0
commit
28a00a5037
1 changed files with 9 additions and 1 deletions
|
|
@ -31,6 +31,14 @@ export default function TextChat({ isSearchView = false }) {
|
||||||
const { conversationId, jailbreak } = conversation || {};
|
const { conversationId, jailbreak } = conversation || {};
|
||||||
const { isSpeechSupported, isListening, text: speechText, toggleListening } = useSpeechRecognition(ask);
|
const { isSpeechSupported, isListening, text: speechText, toggleListening } = useSpeechRecognition(ask);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isListening && speechText) {
|
||||||
|
setText(speechText);
|
||||||
|
} else {
|
||||||
|
setText('');
|
||||||
|
}
|
||||||
|
}, [speechText, isListening, setText]);
|
||||||
|
|
||||||
// auto focus to input, when enter a conversation.
|
// auto focus to input, when enter a conversation.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!conversationId) {
|
if (!conversationId) {
|
||||||
|
|
@ -114,7 +122,7 @@ export default function TextChat({ isSearchView = false }) {
|
||||||
const changeHandler = (e) => {
|
const changeHandler = (e) => {
|
||||||
const { value } = e.target;
|
const { value } = e.target;
|
||||||
|
|
||||||
setText(value || speechText);
|
setText(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPlaceholderText = () => {
|
const getPlaceholderText = () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue