Prechádzať zdrojové kódy

chore(deps): update wry (#1482)

Lucas Fernandes Nogueira 4 rokov pred
rodič
commit
f2d24ef2fb

+ 5 - 0
.changes/update-wry.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+Updated `wry`, fixing an issue with the draggable region.

+ 1 - 1
core/tauri/Cargo.toml

@@ -28,7 +28,7 @@ thiserror = "1.0.24"
 once_cell = "1.7.2"
 tauri-macros = { version = "1.0.0-beta-rc.0", path = "../tauri-macros" }
 tauri-utils = { version = "1.0.0-beta-rc.0", path = "../tauri-utils" }
-wry = "0.7"
+wry = "0.8"
 rand = "0.8"
 reqwest = { version = "0.11", features = [ "json", "multipart" ] }
 tempfile = "3"

+ 9 - 5
core/tauri/src/runtime/flavors/wry.rs

@@ -273,7 +273,9 @@ impl Dispatch for WryDispatcher {
       .add_window_with_configs(
         attributes,
         rpc_handler,
-        custom_protocol.map(create_custom_protocol),
+        custom_protocol
+          .map(create_custom_protocol)
+          .unwrap_or_default(),
         file_drop_handler,
       )
       .map_err(|_| crate::Error::CreateWebview)?;
@@ -480,7 +482,9 @@ impl Runtime for Wry {
       .add_window_with_configs(
         attributes,
         rpc_handler,
-        custom_protocol.map(create_custom_protocol),
+        custom_protocol
+          .map(create_custom_protocol)
+          .unwrap_or_default(),
         file_drop_handler,
       )
       .map_err(|_| crate::Error::CreateWebview)?;
@@ -540,11 +544,11 @@ fn create_file_drop_handler<M: Params<Runtime = Wry>>(
 }
 
 /// Create a wry custom protocol from a tauri custom protocol.
-fn create_custom_protocol(custom_protocol: CustomProtocol) -> wry::CustomProtocol {
-  wry::CustomProtocol {
+fn create_custom_protocol(custom_protocol: CustomProtocol) -> Vec<wry::CustomProtocol> {
+  vec![wry::CustomProtocol {
     name: custom_protocol.name.clone(),
     handler: Box::new(move |data| {
       (custom_protocol.handler)(data).map_err(|_| wry::Error::InitScriptError)
     }),
-  }
+  }]
 }