Prechádzať zdrojové kódy

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

Lucas Fernandes Nogueira 3 rokov pred
rodič
commit
c7696f34ec

+ 5 - 0
.changes/update-response-methods.md

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

+ 10 - 0
core/tauri/src/updater/mod.rs

@@ -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