浏览代码

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