fix(updater): refresh changed update offers before installation

This commit is contained in:
Tunglies
2026-11-03 18:57:05 +08:00
parent 40fd1d5012
commit 2b7b7cc0e7
9 changed files with 87 additions and 148 deletions
+5 -3
View File
@@ -1,7 +1,10 @@
use super::CmdResult;
use crate::{
cmd::StringifyErr as _,
core::{SilentUpdater, updater::DownloadEvent},
core::{
SilentUpdater,
updater::{DownloadEvent, InstallUpdateOutcome},
},
feat,
utils::dirs,
};
@@ -61,8 +64,7 @@ pub async fn install_update(
app_handle: AppHandle,
version: std::string::String,
on_event: Channel<DownloadEvent>,
) -> CmdResult<bool> {
let version: String = version.into();
) -> CmdResult<InstallUpdateOutcome> {
SilentUpdater::global()
.install_update(&app_handle, &version, |event| {
let _ = on_event.send(event);