Skip to content

Commit 909689f

Browse files
committed
fix: some issue
1 parent 80b9a79 commit 909689f

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

src/services/recognize/volcengine_multi_lang/Config.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { recognize } from './index';
1111
import { Language } from './index';
1212

1313
export function Config(props) {
14-
const { instanceKeyupdateServiceList, onClose } = props;
14+
const { instanceKey, updateServiceList, onClose } = props;
1515
const { t } = useTranslation();
1616
const [config, setConfig] = useConfig(
1717
instanceKey,

src/utils/service_instance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export enum ServiceType {
22
TRANSLATE = 'translate',
33
RECOGNIZE = 'recognize',
44
TTS = 'tts',
5-
COLLECTION = 'Collection',
5+
COLLECTION = 'collection',
66
}
77

88
export enum ServiceSourceType {

src/window/Config/pages/History/index.jsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,18 @@ export default function History() {
239239
<>
240240
<ModalHeader>
241241
<div className='flex justify-start'>
242-
{selectedItem.service.startsWith('plugin') ? (
242+
{getServiceSouceType(selectedItem.service) === ServiceSourceType.PLUGIN ? (
243243
<img
244-
src={pluginList['translate'][selectedItem.service].icon}
244+
src={
245+
pluginList['translate'][getServiceName(selectedItem.service)]
246+
.icon
247+
}
245248
className='h-[24px] w-[24px] my-auto'
246249
draggable={false}
247250
/>
248251
) : (
249252
<img
250-
src={`${builtinServices[selectedItem.service].info.icon}`}
253+
src={`${builtinServices[getServiceName(selectedItem.service)].info.icon}`}
251254
className='h-[24px] w-[24px] m-auto mr-[8px]'
252255
draggable={false}
253256
/>
@@ -350,10 +353,14 @@ export default function History() {
350353
>
351354
<img
352355
src={
353-
serviceName.startsWith('plugin')
354-
? pluginList['collection'][serviceName].icon
355-
: builtinCollectionServices[serviceName].info
356-
.icon
356+
getServiceSouceType(instanceKey) ===
357+
ServiceSourceType.PLUGIN
358+
? pluginList['collection'][
359+
getServiceName(instanceKey)
360+
].icon
361+
: builtinCollectionServices[
362+
getServiceName(instanceKey)
363+
].info.icon
357364
}
358365
className='h-[24px] w-[24px]'
359366
/>

src/window/Translate/components/TargetArea/index.jsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,12 @@ export default function TargetArea(props) {
826826
} else {
827827
const instanceConfig =
828828
serviceInstanceConfigMap[collectionServiceInstanceName];
829-
builtinCollectionServices[collectionServiceInstanceName]
830-
.collection(sourceText, result)
829+
builtinCollectionServices[
830+
getServiceName(collectionServiceInstanceName)
831+
]
832+
.collection(sourceText, result, {
833+
config: instanceConfig,
834+
})
831835
.then(
832836
(_) => {
833837
toast.success(t('translate.add_collection_success'), {

0 commit comments

Comments
 (0)