Skip to content

Commit

Permalink
chore(deps): update wry (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Apr 14, 2021
1 parent 8572c6e commit f2d24ef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changes/update-wry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Updated `wry`, fixing an issue with the draggable region.
2 changes: 1 addition & 1 deletion core/tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 9 additions & 5 deletions core/tauri/src/runtime/flavors/wry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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)?;
Expand Down Expand Up @@ -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)
}),
}
}]
}

0 comments on commit f2d24ef

Please sign in to comment.