Skip to content

Commit 71ee5a9

Browse files
committed
Recognize ControlArea
1 parent 4801ed5 commit 71ee5a9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/window/Recognize/ControlArea/index.jsx

+11-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { useConfig } from '../../../hooks';
1212
import { textAtom } from '../TextArea';
1313
import { pluginListAtom } from '..';
1414
import { osType } from '../../../utils/env';
15+
import { whetherAvailableService } from '../../../utils/service_instance';
1516

1617
export const serviceNameAtom = atom();
1718
export const languageAtom = atom();
@@ -53,8 +54,8 @@ export default function ControlArea() {
5354
serviceName.startsWith('[plugin]')
5455
? pluginList[serviceName].icon
5556
: builtinService[serviceName].info.icon === 'system'
56-
? `logo/${osType}.svg`
57-
: builtinService[serviceName].info.icon
57+
? `logo/${osType}.svg`
58+
: builtinService[serviceName].info.icon
5859
}
5960
/>
6061
}
@@ -71,7 +72,12 @@ export default function ControlArea() {
7172
setServiceName(key);
7273
}}
7374
>
74-
{serviceList.map((name) => {
75+
{serviceList.filter(instanceKey => {
76+
return whetherAvailableService(instanceKey, {
77+
[ServiceSourceType.BUILDIN]: builtinService,
78+
[ServiceSourceType.PLUGIN]: pluginList
79+
})
80+
}).map((name) => {
7581
return (
7682
<DropdownItem
7783
key={name}
@@ -82,8 +88,8 @@ export default function ControlArea() {
8288
name.startsWith('[plugin]')
8389
? pluginList[name].icon
8490
: builtinService[name].info.icon === 'system'
85-
? `logo/${osType}.svg`
86-
: builtinService[name].info.icon
91+
? `logo/${osType}.svg`
92+
: builtinService[name].info.icon
8793
}
8894
/>
8995
}

0 commit comments

Comments
 (0)