chore(deps): update wry (#1482)

This commit is contained in:
Lucas Fernandes Nogueira
2021-04-14 14:58:22 -03:00
committed by GitHub
parent 8572c6e407
commit f2d24ef2fb
3 changed files with 15 additions and 6 deletions

5
.changes/update-wry.md Normal file
View File

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

View File

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

View File

@@ -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)
}),
}
}]
}