mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
Update TextChat.jsx
This commit is contained in:
parent
49a9daea34
commit
eb842c699b
1 changed files with 6 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ export default function TextChat({ isSearchView = false }) {
|
|||
const { ask, stopGenerating } = useMessageHandler();
|
||||
const isNotAppendable = latestMessage?.unfinished & !isSubmitting || latestMessage?.error;
|
||||
const { conversationId, jailbreak } = conversation || {};
|
||||
|
||||
const { isSpeechSupported, isListening, text: speechText, toggleListening } = useSpeechRecognition();
|
||||
|
||||
// auto focus to input, when enter a conversation.
|
||||
useEffect(() => {
|
||||
|
|
@ -60,6 +60,9 @@ export default function TextChat({ isSearchView = false }) {
|
|||
const submitMessage = () => {
|
||||
ask({ text });
|
||||
setText('');
|
||||
if (isListening) {
|
||||
toggleListening();
|
||||
}
|
||||
};
|
||||
|
||||
const handleStopGenerating = (e) => {
|
||||
|
|
@ -81,7 +84,7 @@ export default function TextChat({ isSearchView = false }) {
|
|||
}
|
||||
|
||||
if (e.shiftKey && e.altKey && e.key === 'L') {
|
||||
toggleListening(e);
|
||||
toggleListening();
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -111,7 +114,7 @@ export default function TextChat({ isSearchView = false }) {
|
|||
const changeHandler = (e) => {
|
||||
const { value } = e.target;
|
||||
|
||||
setText(value);
|
||||
setText(value || speechText);
|
||||
};
|
||||
|
||||
const getPlaceholderText = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue