mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-15 13:41:39 +03:00
feat(core): add payload data to UpdaterEvent::UpdateAvailable
This commit is contained in:
parent
7cd39c70c9
commit
c29ed94d43
@ -234,7 +234,14 @@ pub use {
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum UpdaterEvent {
|
||||
/// An update is available.
|
||||
UpdateAvailable,
|
||||
UpdateAvailable {
|
||||
/// The update body.
|
||||
body: String,
|
||||
/// The update release date.
|
||||
date: String,
|
||||
/// The update version.
|
||||
version: String,
|
||||
},
|
||||
/// The update is pending.
|
||||
Pending,
|
||||
/// The update has been applied and the app is now up to date.
|
||||
|
@ -464,14 +464,18 @@ pub(crate) fn listener<R: Runtime>(
|
||||
let _ = handle.emit_all(
|
||||
EVENT_UPDATE_AVAILABLE,
|
||||
UpdateManifest {
|
||||
body,
|
||||
body: body.clone(),
|
||||
date: updater.date.clone(),
|
||||
version: updater.version.clone(),
|
||||
},
|
||||
);
|
||||
let _ = handle
|
||||
.create_proxy()
|
||||
.send_event(EventLoopMessage::Updater(UpdaterEvent::UpdateAvailable));
|
||||
let _ = handle.create_proxy().send_event(EventLoopMessage::Updater(
|
||||
UpdaterEvent::UpdateAvailable {
|
||||
body,
|
||||
date: updater.date.clone(),
|
||||
version: updater.version.clone(),
|
||||
},
|
||||
));
|
||||
|
||||
// Listen for `tauri://update-install`
|
||||
handle.once_global(EVENT_INSTALL_UPDATE, move |_msg| {
|
||||
|
Loading…
Reference in New Issue
Block a user