mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 06:53:44 +08:00
fix: sync system proxy status indicator with hotkey
This commit is contained in:
parent
73310b466b
commit
44ca513241
@ -54,10 +54,6 @@ const SettingSystem = ({ onError }: Props) => {
|
|||||||
proxy_auto_config,
|
proxy_auto_config,
|
||||||
} = verge ?? {};
|
} = verge ?? {};
|
||||||
|
|
||||||
const isProxyEnabled = proxy_auto_config
|
|
||||||
? autoproxy?.enable
|
|
||||||
: sysproxy?.enable;
|
|
||||||
|
|
||||||
const onSwitchFormat = (_e: any, value: boolean) => value;
|
const onSwitchFormat = (_e: any, value: boolean) => value;
|
||||||
const onChangeData = (patch: Partial<IVergeConfig>) => {
|
const onChangeData = (patch: Partial<IVergeConfig>) => {
|
||||||
mutateVerge({ ...verge, ...patch }, false);
|
mutateVerge({ ...verge, ...patch }, false);
|
||||||
@ -149,7 +145,13 @@ const SettingSystem = ({ onError }: Props) => {
|
|||||||
icon={SettingsRounded}
|
icon={SettingsRounded}
|
||||||
onClick={() => sysproxyRef.current?.open()}
|
onClick={() => sysproxyRef.current?.open()}
|
||||||
/>
|
/>
|
||||||
{isProxyEnabled ? (
|
{proxy_auto_config ? (
|
||||||
|
autoproxy?.enable ? (
|
||||||
|
<PlayArrowRounded sx={{ color: "success.main", mr: 1 }} />
|
||||||
|
) : (
|
||||||
|
<PauseRounded sx={{ color: "error.main", mr: 1 }} />
|
||||||
|
)
|
||||||
|
) : sysproxy?.enable ? (
|
||||||
<PlayArrowRounded sx={{ color: "success.main", mr: 1 }} />
|
<PlayArrowRounded sx={{ color: "success.main", mr: 1 }} />
|
||||||
) : (
|
) : (
|
||||||
<PauseRounded sx={{ color: "error.main", mr: 1 }} />
|
<PauseRounded sx={{ color: "error.main", mr: 1 }} />
|
||||||
|
@ -166,9 +166,12 @@ const Layout = () => {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// verge 配置更新监听
|
// verge 配置更新监听
|
||||||
addListener("verge://refresh-verge-config", () =>
|
addListener("verge://refresh-verge-config", () => {
|
||||||
mutate("getVergeConfig"),
|
mutate("getVergeConfig");
|
||||||
),
|
// 添加对系统代理状态的刷新
|
||||||
|
mutate("getSystemProxy");
|
||||||
|
mutate("getAutotemProxy");
|
||||||
|
}),
|
||||||
|
|
||||||
// 通知消息监听
|
// 通知消息监听
|
||||||
addListener("verge://notice-message", ({ payload }) =>
|
addListener("verge://notice-message", ({ payload }) =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user