mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
refactor: filter providers by file type instead of subscription info
This commit is contained in:
parent
a187bc7362
commit
d28d33849c
@ -50,6 +50,16 @@ const ProxyProvider: React.FC = () => {
|
|||||||
const providers = useMemo(() => {
|
const providers = useMemo(() => {
|
||||||
if (!data) return []
|
if (!data) return []
|
||||||
return Object.values(data.providers)
|
return Object.values(data.providers)
|
||||||
|
.map(provider => {
|
||||||
|
if (provider.vehicleType === 'Inline' || provider.vehicleType === 'File') {
|
||||||
|
return {
|
||||||
|
...provider,
|
||||||
|
subscriptionInfo: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return provider
|
||||||
|
})
|
||||||
|
|
||||||
.filter(provider => 'subscriptionInfo' in provider)
|
.filter(provider => 'subscriptionInfo' in provider)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
if (a.vehicleType === 'File' && b.vehicleType !== 'File') {
|
if (a.vehicleType === 'File' && b.vehicleType !== 'File') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user