From 57d41498079d3b2dd36a4f98dbcb625ccc73370f Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sun, 11 Jan 2026 15:27:54 +0800 Subject: [PATCH] fix(config): improve runtime config fallback handling --- src-tauri/src/config/config.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/config/config.rs b/src-tauri/src/config/config.rs index 3dc003e70..f051817cb 100644 --- a/src-tauri/src/config/config.rs +++ b/src-tauri/src/config/config.rs @@ -174,11 +174,14 @@ impl Config { }; let runtime = Self::runtime().await; - let runtime_arc = runtime.latest_arc(); - let config = runtime_arc + let runtime_lastest = runtime.latest_arc(); + // Fall back to committed config if runtime config is missing + let runtime_data = runtime.data_arc(); + let config = runtime_lastest .config .as_ref() - .ok_or_else(|| anyhow!("failed to get runtime config"))?; + .or_else(|| runtime_data.config.as_ref()) + .ok_or_else(|| anyhow!("failed to generate runtime config, might need to restart application"))?; help::save_yaml(&path, config, Some("# Generated by Clash Verge")).await?; Ok(path)