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

This reverts commit 35a2b6c75c.

Closes #7994
Closes #7993
This commit is contained in:
Tunglies
2026-09-21 15:08:33 +08:00
parent c6a4de1c6a
commit df79ed3efb
37 changed files with 37 additions and 570 deletions
-13
View File
@@ -127,18 +127,6 @@ pub async fn save_dns_config(dns_config: Mapping) -> CmdResult {
Ok(())
}
#[tauri::command]
pub fn take_dns_override_notice() -> bool {
crate::config::dns::take_dns_override_notice()
}
#[tauri::command]
pub async fn set_dns_override(enabled: bool, confirmation: Option<String>) -> CmdResult<feat::DnsOverrideOutcome> {
feat::set_dns_override(enabled, confirmation)
.await
.map_err(|error| proxy_aware_coded_error(&error, "DNS_OVERRIDE_UPDATE_FAILED"))
}
#[tauri::command]
pub async fn apply_dns_config(apply: bool) -> CmdResult {
if apply {
@@ -181,7 +169,6 @@ pub async fn apply_dns_config(apply: bool) -> CmdResult {
logging!(info, Type::Config, "Config regenerated successfully");
}
logging_error!(Type::Config, Config::sync_dns_override().await);
handle::Handle::refresh_clash();
Ok(())
}
-5
View File
@@ -180,10 +180,6 @@ pub async fn delete_profile(index: String) -> CmdResult {
drop(config_update_guard);
drop(profile_write_guard);
if should_update {
logging_error!(Type::Config, Config::sync_dns_override().await);
}
if let Err(e) = Tray::global().update_tooltip().await {
logging!(warn, Type::Cmd, "异步更新托盘提示失败: {e:#}");
}
@@ -253,7 +249,6 @@ async fn handle_success(current_value: Option<&String>) -> CmdResult<ValidationO
handle::Handle::notify_profile_changed(current);
}
logging_error!(Type::Config, Config::sync_dns_override().await);
Ok(ValidationOutcome::Valid)
}
+1 -2
View File
@@ -10,7 +10,7 @@ use crate::{
module::auto_backup::{AutoBackupManager, AutoBackupTrigger},
utils::dirs,
};
use clash_verge_logging::{Type, logging, logging_error};
use clash_verge_logging::{Type, logging};
use smartstring::alias::String;
use tokio::fs;
@@ -162,7 +162,6 @@ async fn handle_saved_profile_file(
);
match CoreManager::global().update_config_forced().await {
Ok(outcome) if outcome.is_valid() => {
logging_error!(Type::Config, Config::sync_dns_override().await);
handle::Handle::refresh_clash();
Ok(ValidationOutcome::Valid)
}