fix: defer runtime config init until after window

This commit is contained in:
Tunglies
2026-06-29 05:19:38 +08:00
parent 3a4cd2c361
commit 2a5d29cdb2
2 changed files with 22 additions and 3 deletions
+9
View File
@@ -63,6 +63,11 @@ impl Config {
/// 初始化订阅
pub async fn init_config() -> Result<()> {
Self::init_config_before_window().await?;
Self::init_runtime_config().await
}
pub async fn init_config_before_window() -> Result<()> {
Self::ensure_default_profile_items().await?;
let verge = Self::verge().await.latest_arc();
@@ -85,6 +90,10 @@ impl Config {
logging_error!(Type::Core, verge_data.save_file().await);
}
Ok(())
}
pub async fn init_runtime_config() -> Result<()> {
let validation_result = Self::generate_and_validate().await?;
if let Some((msg_type, msg_content)) = validation_result {