@@ -12,6 +12,7 @@ import { useConfig } from '../../../hooks';
12
12
import { textAtom } from '../TextArea' ;
13
13
import { pluginListAtom } from '..' ;
14
14
import { osType } from '../../../utils/env' ;
15
+ import { whetherAvailableService } from '../../../utils/service_instance' ;
15
16
16
17
export const serviceNameAtom = atom ( ) ;
17
18
export const languageAtom = atom ( ) ;
@@ -53,8 +54,8 @@ export default function ControlArea() {
53
54
serviceName . startsWith ( '[plugin]' )
54
55
? pluginList [ serviceName ] . icon
55
56
: builtinService [ serviceName ] . info . icon === 'system'
56
- ? `logo/${ osType } .svg`
57
- : builtinService [ serviceName ] . info . icon
57
+ ? `logo/${ osType } .svg`
58
+ : builtinService [ serviceName ] . info . icon
58
59
}
59
60
/>
60
61
}
@@ -71,7 +72,12 @@ export default function ControlArea() {
71
72
setServiceName ( key ) ;
72
73
} }
73
74
>
74
- { serviceList . map ( ( name ) => {
75
+ { serviceList . filter ( instanceKey => {
76
+ return whetherAvailableService ( instanceKey , {
77
+ [ ServiceSourceType . BUILDIN ] : builtinService ,
78
+ [ ServiceSourceType . PLUGIN ] : pluginList
79
+ } )
80
+ } ) . map ( ( name ) => {
75
81
return (
76
82
< DropdownItem
77
83
key = { name }
@@ -82,8 +88,8 @@ export default function ControlArea() {
82
88
name . startsWith ( '[plugin]' )
83
89
? pluginList [ name ] . icon
84
90
: builtinService [ name ] . info . icon === 'system'
85
- ? `logo/${ osType } .svg`
86
- : builtinService [ name ] . info . icon
91
+ ? `logo/${ osType } .svg`
92
+ : builtinService [ name ] . info . icon
87
93
}
88
94
/>
89
95
}
0 commit comments