mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
fix: manage global proxy correctly
This commit is contained in:
parent
57c411288f
commit
502706931e
|
@ -91,8 +91,24 @@ const ProxyGlobal = (props: Props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (groupName === "DIRECT") setNow("DIRECT");
|
||||
if (groupName === "GLOBAL") setNow(curProxy || "DIRECT");
|
||||
}, [groupName, curProxy]);
|
||||
else if (groupName === "GLOBAL") {
|
||||
if (profiles) {
|
||||
const current = profiles.current;
|
||||
const profile = profiles.items?.find((p) => p.uid === current);
|
||||
|
||||
profile?.selected?.forEach((item) => {
|
||||
if (item.name === "GLOBAL") {
|
||||
if (item.now && item.now !== curProxy) {
|
||||
updateProxy("GLOBAL", item.now).then(() => setNow(item!.now!));
|
||||
mutate("getProxies");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setNow(curProxy || "DIRECT");
|
||||
}
|
||||
}, [groupName, curProxy, profiles]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue
Block a user