Reapply "feat(dns): protect provider DNS from unconfirmed overrides (#7902)"

This reverts commit df79ed3efb.
This commit is contained in:
wonfen
2026-09-21 21:22:45 +08:00
parent d7e0126586
commit 07825afb1e
37 changed files with 570 additions and 36 deletions
+4 -2
View File
@@ -33,6 +33,7 @@ import {
Switch,
} from '@/components/base'
import { useClash } from '@/hooks/use-clash'
import { useVerge } from '@/hooks/use-verge'
import { showNotice } from '@/services/notice-service'
import { useThemeMode } from '@/services/states'
import type { MonacoEditorInstance } from '@/types/monaco'
@@ -183,7 +184,8 @@ const DEFAULT_DNS_CONFIG = {
export function DnsViewer({ ref }: { ref?: Ref<DialogRef> }) {
const { t } = useTranslation()
const { clash, mutateClash } = useClash()
const { mutateClash } = useClash()
const { verge } = useVerge()
const themeMode = useThemeMode()
const [open, setOpen] = useState(false)
@@ -548,7 +550,7 @@ export function DnsViewer({ ref }: { ref?: Ref<DialogRef> }) {
return
}
if (clash?.dns?.enable) {
if (verge?.enable_dns_settings) {
await invoke('apply_dns_config', { apply: true })
mutateClash()
}