mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-17 07:50:33 +08:00
fix(proxy): update system proxy state references to use configState
This commit is contained in:
parent
b277a1e760
commit
d75d3bd86e
@ -143,7 +143,7 @@ export const ProxyTunCard: FC = () => {
|
|||||||
|
|
||||||
const { verge } = useVerge();
|
const { verge } = useVerge();
|
||||||
const { isTunModeAvailable } = useSystemState();
|
const { isTunModeAvailable } = useSystemState();
|
||||||
const { actualState: systemProxyActualState } = useSystemProxyState();
|
const { configState: systemProxyConfigState } = useSystemProxyState();
|
||||||
|
|
||||||
const { enable_tun_mode } = verge ?? {};
|
const { enable_tun_mode } = verge ?? {};
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ export const ProxyTunCard: FC = () => {
|
|||||||
const tabDescription = useMemo(() => {
|
const tabDescription = useMemo(() => {
|
||||||
if (activeTab === "system") {
|
if (activeTab === "system") {
|
||||||
return {
|
return {
|
||||||
text: systemProxyActualState
|
text: systemProxyConfigState
|
||||||
? t("home.components.proxyTun.status.systemProxyEnabled")
|
? t("home.components.proxyTun.status.systemProxyEnabled")
|
||||||
: t("home.components.proxyTun.status.systemProxyDisabled"),
|
: t("home.components.proxyTun.status.systemProxyDisabled"),
|
||||||
tooltip: t("home.components.proxyTun.tooltips.systemProxy"),
|
tooltip: t("home.components.proxyTun.tooltips.systemProxy"),
|
||||||
@ -176,7 +176,7 @@ export const ProxyTunCard: FC = () => {
|
|||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
activeTab,
|
activeTab,
|
||||||
systemProxyActualState,
|
systemProxyConfigState,
|
||||||
enable_tun_mode,
|
enable_tun_mode,
|
||||||
isTunModeAvailable,
|
isTunModeAvailable,
|
||||||
t,
|
t,
|
||||||
@ -199,7 +199,7 @@ export const ProxyTunCard: FC = () => {
|
|||||||
onClick={() => handleTabChange("system")}
|
onClick={() => handleTabChange("system")}
|
||||||
icon={ComputerRounded}
|
icon={ComputerRounded}
|
||||||
label={t("settings.sections.system.toggles.systemProxy")}
|
label={t("settings.sections.system.toggles.systemProxy")}
|
||||||
hasIndicator={systemProxyActualState}
|
hasIndicator={systemProxyConfigState}
|
||||||
/>
|
/>
|
||||||
<TabButton
|
<TabButton
|
||||||
isActive={activeTab === "tun"}
|
isActive={activeTab === "tun"}
|
||||||
|
|||||||
@ -115,7 +115,7 @@ const ProxyControlSwitches = ({
|
|||||||
const { verge, mutateVerge, patchVerge } = useVerge();
|
const { verge, mutateVerge, patchVerge } = useVerge();
|
||||||
const { installServiceAndRestartCore } = useServiceInstaller();
|
const { installServiceAndRestartCore } = useServiceInstaller();
|
||||||
const { uninstallServiceAndRestartCore } = useServiceUninstaller();
|
const { uninstallServiceAndRestartCore } = useServiceUninstaller();
|
||||||
const { actualState: systemProxyActualState, toggleSystemProxy } =
|
const { configState: systemProxyConfigState, toggleSystemProxy } =
|
||||||
useSystemProxyState();
|
useSystemProxyState();
|
||||||
const { isServiceOk, isTunModeAvailable, mutateSystemState } =
|
const { isServiceOk, isTunModeAvailable, mutateSystemState } =
|
||||||
useSystemState();
|
useSystemState();
|
||||||
@ -170,12 +170,12 @@ const ProxyControlSwitches = ({
|
|||||||
{isSystemProxyMode && (
|
{isSystemProxyMode && (
|
||||||
<SwitchRow
|
<SwitchRow
|
||||||
label={t("settings.sections.proxyControl.fields.systemProxy")}
|
label={t("settings.sections.proxyControl.fields.systemProxy")}
|
||||||
active={systemProxyActualState}
|
active={systemProxyConfigState}
|
||||||
infoTitle={t("settings.sections.proxyControl.tooltips.systemProxy")}
|
infoTitle={t("settings.sections.proxyControl.tooltips.systemProxy")}
|
||||||
onInfoClick={() => sysproxyRef.current?.open()}
|
onInfoClick={() => sysproxyRef.current?.open()}
|
||||||
onToggle={(value) => toggleSystemProxy(value)}
|
onToggle={(value) => toggleSystemProxy(value)}
|
||||||
onError={onError}
|
onError={onError}
|
||||||
highlight={systemProxyActualState}
|
highlight={systemProxyConfigState}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user