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:
Tunglies
2026-03-29 02:06:08 +08:00
parent 99bbd7ee5a
commit 7a06a5a069
3 changed files with 11 additions and 14 deletions
-2
View File
@@ -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