refactor(updater): own the updater state in a single actor

This commit is contained in:
Tunglies
2026-11-27 16:00:55 +08:00
parent 055dbf5d35
commit b68438556a
4 changed files with 285 additions and 112 deletions
+4 -2
View File
@@ -163,8 +163,10 @@ pub(super) async fn apply(config_write: &MutexGuard<'_, ()>, patch: Patch<'_>, e
transaction.commit();
match patch {
Patch::Verge { patch, .. } => {
if patch.auto_check_update == Some(false) {
SilentUpdater::global().discard_pending().await;
if patch.auto_check_update == Some(false)
&& let Some(updater) = SilentUpdater::global()
{
updater.discard_pending().await;
}
if effects.contains(&Effect::ClashConfig) {
announce(Refresh::Clash);