From 7f267fa727aa897346b6f1d8212a829ee36a8cdb Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sun, 9 Nov 2025 21:25:36 +0800 Subject: [PATCH] fix: update configuration data access from latest_arc to data_arc in Clash and WebDAV commands and init windows --- src-tauri/src/cmd/clash.rs | 2 +- src-tauri/src/cmd/webdav.rs | 2 +- src-tauri/src/core/hotkey.rs | 6 +++--- src-tauri/src/utils/resolve/mod.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/cmd/clash.rs b/src-tauri/src/cmd/clash.rs index 84855bd5e..7ca0bb454 100644 --- a/src-tauri/src/cmd/clash.rs +++ b/src-tauri/src/cmd/clash.rs @@ -22,7 +22,7 @@ pub async fn copy_clash_env() -> CmdResult { /// 获取Clash信息 #[tauri::command] pub async fn get_clash_info() -> CmdResult { - Ok(Config::clash().await.latest_arc().get_client_info()) + Ok(Config::clash().await.data_arc().get_client_info()) } /// 修改Clash配置 diff --git a/src-tauri/src/cmd/webdav.rs b/src-tauri/src/cmd/webdav.rs index 209f39e7a..20ae9d048 100644 --- a/src-tauri/src/cmd/webdav.rs +++ b/src-tauri/src/cmd/webdav.rs @@ -19,7 +19,7 @@ pub async fn save_webdav_config(url: String, username: String, password: String) Config::verge().await.edit_draft(|e| e.patch_config(&patch)); Config::verge().await.apply(); - let verge_data = Config::verge().await.latest_arc(); + let verge_data = Config::verge().await.data_arc(); verge_data.save_file().await.stringify_err()?; core::backup::WebDavClient::global().reset(); Ok(()) diff --git a/src-tauri/src/core/hotkey.rs b/src-tauri/src/core/hotkey.rs index f75e7e922..6a06756c2 100755 --- a/src-tauri/src/core/hotkey.rs +++ b/src-tauri/src/core/hotkey.rs @@ -227,7 +227,7 @@ impl Hotkey { let is_enable_global_hotkey = Config::verge() .await - .latest_arc() + .data_arc() .enable_global_hotkey .unwrap_or(true); @@ -264,7 +264,7 @@ singleton_with_logging!(Hotkey, INSTANCE, "Hotkey"); impl Hotkey { pub async fn init(&self, skip: bool) -> Result<()> { let verge = Config::verge().await; - let enable_global_hotkey = !skip && verge.latest_arc().enable_global_hotkey.unwrap_or(true); + let enable_global_hotkey = !skip && verge.data_arc().enable_global_hotkey.unwrap_or(true); logging!( debug, @@ -274,7 +274,7 @@ impl Hotkey { ); // Extract hotkeys data before async operations - let hotkeys = verge.latest_arc().hotkeys.as_ref().cloned(); + let hotkeys = verge.data_arc().hotkeys.as_ref().cloned(); if let Some(hotkeys) = hotkeys { logging!( diff --git a/src-tauri/src/utils/resolve/mod.rs b/src-tauri/src/utils/resolve/mod.rs index 5a3556161..542cac466 100644 --- a/src-tauri/src/utils/resolve/mod.rs +++ b/src-tauri/src/utils/resolve/mod.rs @@ -179,7 +179,7 @@ pub(super) async fn refresh_tray_menu() { pub(super) async fn init_window() { let is_silent_start = Config::verge() .await - .latest_arc() + .data_arc() .enable_silent_start .unwrap_or(false); #[cfg(target_os = "macos")]