From 909689f660293195c2a844d3630ed1374d9640fa Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Mon, 24 Jun 2024 15:59:04 +0800 Subject: [PATCH] fix: some issue --- .../volcengine_multi_lang/Config.jsx | 2 +- src/utils/service_instance.ts | 2 +- src/window/Config/pages/History/index.jsx | 21 ++++++++++++------- .../Translate/components/TargetArea/index.jsx | 8 +++++-- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/services/recognize/volcengine_multi_lang/Config.jsx b/src/services/recognize/volcengine_multi_lang/Config.jsx index 86a893615d..f13d96e82d 100644 --- a/src/services/recognize/volcengine_multi_lang/Config.jsx +++ b/src/services/recognize/volcengine_multi_lang/Config.jsx @@ -11,7 +11,7 @@ import { recognize } from './index'; import { Language } from './index'; export function Config(props) { - const { instanceKeyupdateServiceList, onClose } = props; + const { instanceKey, updateServiceList, onClose } = props; const { t } = useTranslation(); const [config, setConfig] = useConfig( instanceKey, diff --git a/src/utils/service_instance.ts b/src/utils/service_instance.ts index 766739da01..877f5dc8be 100644 --- a/src/utils/service_instance.ts +++ b/src/utils/service_instance.ts @@ -2,7 +2,7 @@ export enum ServiceType { TRANSLATE = 'translate', RECOGNIZE = 'recognize', TTS = 'tts', - COLLECTION = 'Collection', + COLLECTION = 'collection', } export enum ServiceSourceType { diff --git a/src/window/Config/pages/History/index.jsx b/src/window/Config/pages/History/index.jsx index ca79b8f907..f1d113f76b 100644 --- a/src/window/Config/pages/History/index.jsx +++ b/src/window/Config/pages/History/index.jsx @@ -239,15 +239,18 @@ export default function History() { <>
- {selectedItem.service.startsWith('plugin') ? ( + {getServiceSouceType(selectedItem.service) === ServiceSourceType.PLUGIN ? ( ) : ( @@ -350,10 +353,14 @@ export default function History() { > diff --git a/src/window/Translate/components/TargetArea/index.jsx b/src/window/Translate/components/TargetArea/index.jsx index 68e54017f1..5ffeee562d 100644 --- a/src/window/Translate/components/TargetArea/index.jsx +++ b/src/window/Translate/components/TargetArea/index.jsx @@ -826,8 +826,12 @@ export default function TargetArea(props) { } else { const instanceConfig = serviceInstanceConfigMap[collectionServiceInstanceName]; - builtinCollectionServices[collectionServiceInstanceName] - .collection(sourceText, result) + builtinCollectionServices[ + getServiceName(collectionServiceInstanceName) + ] + .collection(sourceText, result, { + config: instanceConfig, + }) .then( (_) => { toast.success(t('translate.add_collection_success'), {