Commit bf5a6229 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent 2972774d
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
if (_responses.at(0)) { if (_responses.at(0)) {
const content = _responses[0]; const content = _responses[0];
if (content) { if ((content ?? '').trim() !== '') {
assistantSpeakingHandler(content); assistantSpeakingHandler(content);
} }
} }
......
...@@ -211,6 +211,7 @@ ...@@ -211,6 +211,7 @@
speaking = null; speaking = null;
speakingIdx = null; speakingIdx = null;
} else { } else {
if ((message?.content ?? '').trim() !== '') {
speaking = true; speaking = true;
if ($config.audio.tts.engine === 'openai') { if ($config.audio.tts.engine === 'openai') {
...@@ -274,7 +275,8 @@ ...@@ -274,7 +275,8 @@
const voice = const voice =
voices voices
?.filter( ?.filter(
(v) => v.voiceURI === ($settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice) (v) =>
v.voiceURI === ($settings?.audio?.tts?.voice ?? $config?.audio?.tts?.voice)
) )
?.at(0) ?? undefined; ?.at(0) ?? undefined;
...@@ -299,6 +301,9 @@ ...@@ -299,6 +301,9 @@
} }
}, 100); }, 100);
} }
} else {
toast.error('No content to speak');
}
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment