mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix: proxy-provider
This commit is contained in:
parent
afe93774b0
commit
5a84d6485e
@ -50,15 +50,10 @@ 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)
|
||||||
.filter(provider => 'subscriptionInfo' in provider)
|
.filter((provider) => provider.vehicleType !== 'Compatible')
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
if (a.vehicleType === 'File' && b.vehicleType !== 'File') {
|
const order = { File: 1, Inline: 2, HTTP: 3 }
|
||||||
return -1
|
return (order[a.vehicleType] || 4) - (order[b.vehicleType] || 4)
|
||||||
}
|
|
||||||
if (a.vehicleType !== 'File' && b.vehicleType === 'File') {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
})
|
})
|
||||||
}, [data])
|
}, [data])
|
||||||
const [updating, setUpdating] = useState(Array(providers.length).fill(false))
|
const [updating, setUpdating] = useState(Array(providers.length).fill(false))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user