From 93a9ac68cd11253534eaba05ce6b3b8f96958c36 Mon Sep 17 00:00:00 2001 From: an-lee Date: Thu, 21 Nov 2024 08:58:57 +0800 Subject: [PATCH] fix null --- .../transcription-create-form.tsx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/enjoy/src/renderer/components/transcriptions/transcription-create-form.tsx b/enjoy/src/renderer/components/transcriptions/transcription-create-form.tsx index 2c37e1d0..3fba9438 100644 --- a/enjoy/src/renderer/components/transcriptions/transcription-create-form.tsx +++ b/enjoy/src/renderer/components/transcriptions/transcription-create-form.tsx @@ -30,7 +30,7 @@ import { toast, } from "@renderer/components/ui"; import { t } from "i18next"; -import { LANGUAGES, WHISPER_MODELS } from "@/constants"; +import { LANGUAGES } from "@/constants"; import { ChevronDownIcon, ChevronUpIcon, LoaderIcon } from "lucide-react"; import { parseText } from "media-captions"; import { milisecondsToTimestamp } from "@/utils"; @@ -184,21 +184,23 @@ export const TranscriptionCreateForm = (props: { - {form.watch("service") === SttEngineOptionEnum.LOCAL && ( - <> -
{t("localSpeechToTextDescription")}
-
- * {t("model")}: {echogardenSttConfig.engine} /{" "} - { - echogardenSttConfig[ - echogardenSttConfig.engine.replace(".cpp", "Cpp") as - | "whisper" - | "whisperCpp" - ]?.model - } -
- - )} + {form.watch("service") === SttEngineOptionEnum.LOCAL && + echogardenSttConfig && ( + <> +
{t("localSpeechToTextDescription")}
+
+ * {t("model")}: {echogardenSttConfig.engine} /{" "} + { + echogardenSttConfig[ + echogardenSttConfig.engine?.replace( + ".cpp", + "Cpp" + ) as "whisper" | "whisperCpp" + ]?.model + } +
+ + )} {form.watch("service") === SttEngineOptionEnum.ENJOY_AZURE && t("enjoyAzureSpeechToTextDescription")}