From f4d9de2a149c872ecc74372ce4439e2e7166099e Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Tue, 6 Aug 2019 16:00:26 +0800 Subject: [PATCH] Fix: cannot switch proxy in Global --- src/stores/HookStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/HookStore.ts b/src/stores/HookStore.ts index f7f69d9..17b04dd 100644 --- a/src/stores/HookStore.ts +++ b/src/stores/HookStore.ts @@ -44,6 +44,8 @@ function useData () { const policyGroup = new Set(['Selector', 'URLTest', 'Fallback', 'LoadBalance']) const unUsedProxy = new Set(['DIRECT', 'REJECT', 'GLOBAL']) const proxyList = rawProxies.data.proxies['GLOBAL'] as API.Group + // fix missing name + proxyList.name = 'GLOBAL' const proxies = proxyList.all .filter(key => !unUsedProxy.has(key)) .map(key => ({ ...rawProxies.data.proxies[key], name: key })) @@ -51,7 +53,7 @@ function useData () { setMulti({ proxy: proxy as API.Proxy[], - proxyGroup: groups as API.Group[], + proxyGroup: general.mode === 'Global' ? [proxyList] : groups as API.Group[], rules: rules.data.rules }) }