mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
fix: remove dead localStorage writes and hardcoded key
- Remove unused `dns_settings_enabled` localStorage writes in setting-clash.tsx — state is sourced from verge config, these writes were never read anywhere. - Replace hardcoded `'last_check_update'` localStorage read in system-info-card.tsx with exported `readLastCheckTime()` from the useUpdate hook, keeping the key in a single source of truth.
This commit is contained in:
@@ -78,7 +78,6 @@ const SettingClash = ({ onError }: Props) => {
|
||||
const handleDnsToggle = useLockFn(async (enable: boolean) => {
|
||||
try {
|
||||
setDnsSettingsEnabled(enable)
|
||||
localStorage.setItem('dns_settings_enabled', String(enable))
|
||||
await patchVerge({ enable_dns_settings: enable })
|
||||
await invoke('apply_dns_config', { apply: enable })
|
||||
setTimeout(() => {
|
||||
@@ -86,7 +85,6 @@ const SettingClash = ({ onError }: Props) => {
|
||||
}, 500)
|
||||
} catch (err: any) {
|
||||
setDnsSettingsEnabled(!enable)
|
||||
localStorage.setItem('dns_settings_enabled', String(!enable))
|
||||
showNotice.error(err)
|
||||
await patchVerge({ enable_dns_settings: !enable }).catch(() => {})
|
||||
throw err
|
||||
|
||||
Reference in New Issue
Block a user