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