From f2d24ef2fbd95ec7d3433ba651964f4aa3b7f48c Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 14 Apr 2021 14:58:22 -0300 Subject: [PATCH] chore(deps): update wry (#1482) --- .changes/update-wry.md | 5 +++++ core/tauri/Cargo.toml | 2 +- core/tauri/src/runtime/flavors/wry.rs | 14 +++++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .changes/update-wry.md diff --git a/.changes/update-wry.md b/.changes/update-wry.md new file mode 100644 index 000000000..6aa99928f --- /dev/null +++ b/.changes/update-wry.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Updated `wry`, fixing an issue with the draggable region. diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 2e73e4ffa..85a8a40fd 100644 --- a/core/tauri/Cargo.toml +++ b/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" diff --git a/core/tauri/src/runtime/flavors/wry.rs b/core/tauri/src/runtime/flavors/wry.rs index 1b48d2df0..b2aab7088 100644 --- a/core/tauri/src/runtime/flavors/wry.rs +++ b/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>( } /// 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 { + vec![wry::CustomProtocol { name: custom_protocol.name.clone(), handler: Box::new(move |data| { (custom_protocol.handler)(data).map_err(|_| wry::Error::InitScriptError) }), - } + }] }