فهرست منبع

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

Lucas Fernandes Nogueira 3 سال پیش
والد
کامیت
c7696f34ec
2فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 5 0
      .changes/update-response-methods.md
  2. 10 0
      core/tauri/src/updater/mod.rs

+ 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