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:
@@ -18,13 +18,18 @@ export const useSystemProxyState = () => {
|
||||
const getSystemProxyActualState = () => {
|
||||
const userEnabled = enable_system_proxy ?? false;
|
||||
|
||||
// 用户配置状态应该与系统实际状态一致
|
||||
// 如果用户启用了系统代理,检查实际的系统状态
|
||||
if (userEnabled) {
|
||||
return true;
|
||||
if (proxy_auto_config) {
|
||||
return autoproxy?.enable ?? false;
|
||||
} else {
|
||||
return sysproxy?.enable ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
return autoproxy?.enable === false && sysproxy?.enable === false
|
||||
? false
|
||||
: userEnabled;
|
||||
// 用户没有启用时,返回 false
|
||||
return false;
|
||||
};
|
||||
|
||||
const getSystemProxyIndicator = () => {
|
||||
|
||||
Reference in New Issue
Block a user