mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: cannot switch proxy in Global
This commit is contained in:
parent
e52541847f
commit
f4d9de2a14
@ -44,6 +44,8 @@ function useData () {
|
|||||||
const policyGroup = new Set(['Selector', 'URLTest', 'Fallback', 'LoadBalance'])
|
const policyGroup = new Set(['Selector', 'URLTest', 'Fallback', 'LoadBalance'])
|
||||||
const unUsedProxy = new Set(['DIRECT', 'REJECT', 'GLOBAL'])
|
const unUsedProxy = new Set(['DIRECT', 'REJECT', 'GLOBAL'])
|
||||||
const proxyList = rawProxies.data.proxies['GLOBAL'] as API.Group
|
const proxyList = rawProxies.data.proxies['GLOBAL'] as API.Group
|
||||||
|
// fix missing name
|
||||||
|
proxyList.name = 'GLOBAL'
|
||||||
const proxies = proxyList.all
|
const proxies = proxyList.all
|
||||||
.filter(key => !unUsedProxy.has(key))
|
.filter(key => !unUsedProxy.has(key))
|
||||||
.map(key => ({ ...rawProxies.data.proxies[key], name: key }))
|
.map(key => ({ ...rawProxies.data.proxies[key], name: key }))
|
||||||
@ -51,7 +53,7 @@ function useData () {
|
|||||||
|
|
||||||
setMulti({
|
setMulti({
|
||||||
proxy: proxy as API.Proxy[],
|
proxy: proxy as API.Proxy[],
|
||||||
proxyGroup: groups as API.Group[],
|
proxyGroup: general.mode === 'Global' ? [proxyList] : groups as API.Group[],
|
||||||
rules: rules.data.rules
|
rules: rules.data.rules
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user