mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
Update HoverButtons.tsx
This commit is contained in:
parent
e9882dedad
commit
7ae0e7e97c
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ export default function HoverButtons({
|
||||||
const { endpoint } = conversation ?? {};
|
const { endpoint } = conversation ?? {};
|
||||||
const [isCopied, setIsCopied] = useState(false);
|
const [isCopied, setIsCopied] = useState(false);
|
||||||
const [isSpeaking, setIsSpeaking] = useState(false);
|
const [isSpeaking, setIsSpeaking] = useState(false);
|
||||||
const { synthesizeSpeech } = useSpeechSynthesis();
|
const { synthesizeSpeech, cancelSpeech } = useSpeechSynthesis();
|
||||||
const { hideEditButton, regenerateEnabled, continueSupported } = useGenerations({
|
const { hideEditButton, regenerateEnabled, continueSupported } = useGenerations({
|
||||||
isEditing,
|
isEditing,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
|
@ -52,7 +52,7 @@ export default function HoverButtons({
|
||||||
|
|
||||||
const toggleSpeech = () => {
|
const toggleSpeech = () => {
|
||||||
if (isSpeaking) {
|
if (isSpeaking) {
|
||||||
synthesizeSpeech.cancel();
|
cancelSpeech();
|
||||||
} else {
|
} else {
|
||||||
// const utterance = new SpeechSynthesisUtterance(message?.text ?? ""); // Assuming 'text' is the field in message that contains the text to speak
|
// const utterance = new SpeechSynthesisUtterance(message?.text ?? ""); // Assuming 'text' is the field in message that contains the text to speak
|
||||||
synthesizeSpeech(message?.text ?? "");
|
synthesizeSpeech(message?.text ?? "");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue