From eac3b79b7b649206440e6dd8933afbfb4e63690b Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 15 Sep 2026 01:33:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(voices):=20clonedList=20=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=20useMemo=20=E5=9B=9E=E8=B0=83=E5=86=85=E9=81=BF=E5=85=8D=20re?= =?UTF-8?q?act-hooks/exhaustive-deps=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/pages/voices/components/TtsModal.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/web/src/pages/voices/components/TtsModal.tsx b/apps/web/src/pages/voices/components/TtsModal.tsx index 3ad346162..1f765f918 100755 --- a/apps/web/src/pages/voices/components/TtsModal.tsx +++ b/apps/web/src/pages/voices/components/TtsModal.tsx @@ -34,10 +34,9 @@ const TtsModal: React.FC = ({ onSave, }) => { // 预置音色(含空默认)仅支持 zh/en;克隆音色支持全语言列表 - const clonedList = clonedVoices ?? [] const isCloneVoice = useMemo( - () => !!ttsVoiceId && clonedList.some((v) => v.id === ttsVoiceId), - [ttsVoiceId, clonedList], + () => !!ttsVoiceId && (clonedVoices ?? []).some((v) => v.id === ttsVoiceId), + [ttsVoiceId, clonedVoices], ) const languageOptions = isCloneVoice ? CLONE_TTS_LANGUAGE_OPTIONS : PRESET_TTS_LANGUAGE_OPTIONS