From 687dabc77714e0566ae3148b41b2b11269f4d899 Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 3 Dec 2024 16:06:33 +0800 Subject: [PATCH] fix: audio set progress error --- src/components/alert-info/index.tsx | 51 ++++++++++--------- src/components/list-input/index.tsx | 6 +-- src/components/logs-viewer/parse-ansi.ts | 5 -- src/components/logs-viewer/parse-worker.ts | 5 -- src/locales/en-US/models.ts | 6 ++- src/locales/zh-CN/models.ts | 6 ++- src/pages/llmodels/components/gpu-card.tsx | 11 ++-- .../playground/components/ground-stt.tsx | 6 +-- .../playground/components/ground-tts.tsx | 11 ++-- 9 files changed, 52 insertions(+), 55 deletions(-) diff --git a/src/components/alert-info/index.tsx b/src/components/alert-info/index.tsx index c8d23f1f..6c2bb29d 100644 --- a/src/components/alert-info/index.tsx +++ b/src/components/alert-info/index.tsx @@ -13,33 +13,34 @@ interface AlertInfoProps { const AlertInfo: React.FC = (props) => { const { message, type, rows = 1, ellipsis, style } = props; - if (!message) { - return null; - } return ( - - - {message} - + <> + {message ? ( + + + {message} + + ) : null} + ); }; diff --git a/src/components/list-input/index.tsx b/src/components/list-input/index.tsx index 428f01aa..a6964448 100644 --- a/src/components/list-input/index.tsx +++ b/src/components/list-input/index.tsx @@ -88,11 +88,11 @@ const ListInput: React.FC = (props) => {
{loading && (
diff --git a/src/pages/playground/components/ground-tts.tsx b/src/pages/playground/components/ground-tts.tsx index 94cb20be..72a602f2 100644 --- a/src/pages/playground/components/ground-tts.tsx +++ b/src/pages/playground/components/ground-tts.tsx @@ -157,7 +157,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { console.log('result:', res); - if (res?.error) { + if (res?.status_code !== 200) { setTokenResult({ error: true, errorMessage: @@ -212,14 +212,11 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { const res = await queryModelVoices({ model: value }); - if (res?.error) { + if (res?.status_code !== 200) { setVoiceError({ error: true, errorMessage: - res?.data?.error?.message || - res?.data?.error || - res.error?.detail || - '' + res?.data?.error?.message || res?.data?.error || res?.detail || '' }); setVoiceList([]); return; @@ -248,7 +245,7 @@ const GroundLeft: React.FC = forwardRef((props, ref) => { setVoiceError({ error: true, errorMessage: - res?.error?.message || res?.data?.error || res.error?.detail || '' + res?.error?.message || res?.data?.error || res?.detail || '' }); } setVoiceList([]);