feat(updater): add body and date getters (#3802)

This commit is contained in:
Lucas Fernandes Nogueira
2022-03-29 07:30:44 -07:00
committed by GitHub
parent b14aa89673
commit c7696f34ec
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri": patch
---
Added `UpdateResponse::body` and `UpdateResponse::date`.

View File

@@ -637,6 +637,16 @@ impl<R: Runtime> UpdateResponse<R> {
&self.update.version
}
/// The update date.
pub fn date(&self) -> &str {
&self.update.date
}
/// The update description.
pub fn body(&self) -> Option<&String> {
self.update.body.as_ref()
}
/// Downloads and installs the update.
pub async fn download_and_install(self) -> Result<()> {
download_and_install(self.update).await