fix: resolve system proxy status detection and display inconsistency

- Fixed getSystemProxyActualState logic to properly check actual system status
- Unified system proxy state display across all components
- Replaced systemProxyIndicator with actualState for consistent UI display
- Updated components: setting-system, ProxyControlSwitches, proxy-tun-card
- Added entry to v2.4.0 changelog
This commit is contained in:
Tunglies
2025-08-07 02:18:50 +08:00
parent 8046dad56d
commit 3f5cd6c26a
6 changed files with 21 additions and 21 deletions

View File

@@ -146,7 +146,7 @@ export const ProxyTunCard: FC = () => {
const { verge } = useVerge();
const { isAdminMode } = useSystemState();
const { indicator: systemProxyIndicator } = useSystemProxyState();
const { actualState: systemProxyActualState } = useSystemProxyState();
const { enable_tun_mode } = verge ?? {};
@@ -182,7 +182,7 @@ export const ProxyTunCard: FC = () => {
const tabDescription = useMemo(() => {
if (activeTab === "system") {
return {
text: systemProxyIndicator
text: systemProxyActualState
? t("System Proxy Enabled")
: t("System Proxy Disabled"),
tooltip: t("System Proxy Info"),
@@ -197,7 +197,7 @@ export const ProxyTunCard: FC = () => {
tooltip: t("TUN Mode Intercept Info"),
};
}
}, [activeTab, systemProxyIndicator, enable_tun_mode, isTunAvailable, t]);
}, [activeTab, systemProxyActualState, enable_tun_mode, isTunAvailable, t]);
return (
<Box sx={{ display: "flex", flexDirection: "column", width: "100%" }}>
@@ -216,7 +216,7 @@ export const ProxyTunCard: FC = () => {
onClick={() => handleTabChange("system")}
icon={ComputerRounded}
label={t("System Proxy")}
hasIndicator={systemProxyIndicator}
hasIndicator={systemProxyActualState}
/>
<TabButton
isActive={activeTab === "tun"}