Skip to content

Commit

Permalink
fix: some issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jun 24, 2024
1 parent 80b9a79 commit 909689f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/services/recognize/volcengine_multi_lang/Config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/service_instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export enum ServiceType {
TRANSLATE = 'translate',
RECOGNIZE = 'recognize',
TTS = 'tts',
COLLECTION = 'Collection',
COLLECTION = 'collection',
}

export enum ServiceSourceType {
Expand Down
21 changes: 14 additions & 7 deletions src/window/Config/pages/History/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,18 @@ export default function History() {
<>
<ModalHeader>
<div className='flex justify-start'>
{selectedItem.service.startsWith('plugin') ? (
{getServiceSouceType(selectedItem.service) === ServiceSourceType.PLUGIN ? (
<img
src={pluginList['translate'][selectedItem.service].icon}
src={
pluginList['translate'][getServiceName(selectedItem.service)]
.icon
}
className='h-[24px] w-[24px] my-auto'
draggable={false}
/>
) : (
<img
src={`${builtinServices[selectedItem.service].info.icon}`}
src={`${builtinServices[getServiceName(selectedItem.service)].info.icon}`}
className='h-[24px] w-[24px] m-auto mr-[8px]'
draggable={false}
/>
Expand Down Expand Up @@ -350,10 +353,14 @@ export default function History() {
>
<img
src={
serviceName.startsWith('plugin')
? pluginList['collection'][serviceName].icon
: builtinCollectionServices[serviceName].info
.icon
getServiceSouceType(instanceKey) ===
ServiceSourceType.PLUGIN
? pluginList['collection'][
getServiceName(instanceKey)
].icon
: builtinCollectionServices[
getServiceName(instanceKey)
].info.icon
}
className='h-[24px] w-[24px]'
/>
Expand Down
8 changes: 6 additions & 2 deletions src/window/Translate/components/TargetArea/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'), {
Expand Down

0 comments on commit 909689f

Please sign in to comment.