mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-01 02:20:07 +08:00
fix(profile): recover interrupted subscription refreshes
Recover pending redo at startup, coordinate profile readers and writers, and publish Draft state only after persistence. Keep the Windows legacy path by default.
This commit is contained in:
@@ -470,7 +470,8 @@ async fn initialize_config_files() -> Result<()> {
|
||||
logging!(info, Type::Setup, "Created verge config at {:?}", path);
|
||||
}
|
||||
|
||||
if let Ok(path) = dirs::profiles_path()
|
||||
if crate::config::profile_storage::check().is_ok()
|
||||
&& let Ok(path) = dirs::profiles_path()
|
||||
&& !path.exists()
|
||||
{
|
||||
let template = IProfiles::default();
|
||||
@@ -489,6 +490,10 @@ async fn initialize_config_files() -> Result<()> {
|
||||
|
||||
/// Initializes configuration required before Tauri setup.
|
||||
pub async fn init_config() -> Result<()> {
|
||||
if let Err(error) = crate::config::profile_storage::recover_at_startup().await {
|
||||
logging!(error, Type::Config, "Profile recovery failed: {error:#}");
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
migrate_legacy_macos_logs().await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user