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)