fix(proxy): update system proxy state references to use configState

This commit is contained in:
Tunglies
2026-01-01 17:40:56 +08:00
parent b277a1e760
commit d75d3bd86e
2 changed files with 7 additions and 7 deletions

View File

@@ -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"}

View File

@@ -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}
/>
)}