fix: update configuration data access from latest_arc to data_arc in Clash and WebDAV commands and init windows

This commit is contained in:
Tunglies
2025-11-09 21:25:36 +08:00
parent f5160ef277
commit 7f267fa727
4 changed files with 6 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ pub async fn copy_clash_env() -> CmdResult {
/// 获取Clash信息 /// 获取Clash信息
#[tauri::command] #[tauri::command]
pub async fn get_clash_info() -> CmdResult<ClashInfo> { pub async fn get_clash_info() -> CmdResult<ClashInfo> {
Ok(Config::clash().await.latest_arc().get_client_info()) Ok(Config::clash().await.data_arc().get_client_info())
} }
/// 修改Clash配置 /// 修改Clash配置

View File

@@ -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.edit_draft(|e| e.patch_config(&patch));
Config::verge().await.apply(); 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()?; verge_data.save_file().await.stringify_err()?;
core::backup::WebDavClient::global().reset(); core::backup::WebDavClient::global().reset();
Ok(()) Ok(())

View File

@@ -227,7 +227,7 @@ impl Hotkey {
let is_enable_global_hotkey = Config::verge() let is_enable_global_hotkey = Config::verge()
.await .await
.latest_arc() .data_arc()
.enable_global_hotkey .enable_global_hotkey
.unwrap_or(true); .unwrap_or(true);
@@ -264,7 +264,7 @@ singleton_with_logging!(Hotkey, INSTANCE, "Hotkey");
impl Hotkey { impl Hotkey {
pub async fn init(&self, skip: bool) -> Result<()> { pub async fn init(&self, skip: bool) -> Result<()> {
let verge = Config::verge().await; 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!( logging!(
debug, debug,
@@ -274,7 +274,7 @@ impl Hotkey {
); );
// Extract hotkeys data before async operations // 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 { if let Some(hotkeys) = hotkeys {
logging!( logging!(

View File

@@ -179,7 +179,7 @@ pub(super) async fn refresh_tray_menu() {
pub(super) async fn init_window() { pub(super) async fn init_window() {
let is_silent_start = Config::verge() let is_silent_start = Config::verge()
.await .await
.latest_arc() .data_arc()
.enable_silent_start .enable_silent_start
.unwrap_or(false); .unwrap_or(false);
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]