From 589de36af791c54dc0be775eff74c1084c78755f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 23 Apr 2024 15:56:09 -0400 Subject: [PATCH] fix: #1705 --- src/lib/components/chat/Settings/Audio.svelte | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/Settings/Audio.svelte b/src/lib/components/chat/Settings/Audio.svelte index 32a71dc18..71fb7957e 100644 --- a/src/lib/components/chat/Settings/Audio.svelte +++ b/src/lib/components/chat/Settings/Audio.svelte @@ -75,14 +75,16 @@ }; const updateConfigHandler = async () => { - const res = await updateAudioConfig(localStorage.token, { - url: OpenAIUrl, - key: OpenAIKey - }); + if (TTSEngine === 'openai') { + const res = await updateAudioConfig(localStorage.token, { + url: OpenAIUrl, + key: OpenAIKey + }); - if (res) { - OpenAIUrl = res.OPENAI_API_BASE_URL; - OpenAIKey = res.OPENAI_API_KEY; + if (res) { + OpenAIUrl = res.OPENAI_API_BASE_URL; + OpenAIKey = res.OPENAI_API_KEY; + } } };