mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
,fix: when updating the verge configuration, notification error
This commit is contained in:
parent
30ebfd84cf
commit
ba1a7e0fd6
|
@ -181,7 +181,7 @@ pub async fn patch_verge(patch: IVerge) -> Result<()> {
|
|||
generated = true;
|
||||
}
|
||||
} else if tun_mode.is_some() {
|
||||
update_core_config().await?;
|
||||
update_core_config(false).await?;
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
if (redir_enabled.is_some() || redir_port.is_some()) && !generated {
|
||||
|
@ -287,22 +287,26 @@ pub async fn update_profile(uid: String, option: Option<PrfOption>) -> Result<()
|
|||
};
|
||||
|
||||
if should_update {
|
||||
update_core_config().await?;
|
||||
update_core_config(true).await?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// 更新订阅
|
||||
async fn update_core_config() -> Result<()> {
|
||||
async fn update_core_config(notice: bool) -> Result<()> {
|
||||
match CoreManager::global().update_config().await {
|
||||
Ok(_) => {
|
||||
handle::Handle::refresh_clash();
|
||||
handle::Handle::notice_message("set_config::ok", "ok");
|
||||
if notice {
|
||||
handle::Handle::notice_message("set_config::ok", "ok");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Err(err) => {
|
||||
handle::Handle::notice_message("set_config::error", format!("{err}"));
|
||||
if notice {
|
||||
handle::Handle::notice_message("set_config::error", format!("{err}"));
|
||||
}
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user