fix: proxy-provider

This commit is contained in:
xishang0128 2025-04-27 20:55:25 +08:00 committed by miwu04
parent afe93774b0
commit 5a84d6485e
No known key found for this signature in database
GPG Key ID: D22D460B028C00CE

View File

@ -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))