Skip to content

Commit f2d24ef

Browse files
authored
chore(deps): update wry (#1482)
1 parent 8572c6e commit f2d24ef

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.changes/update-wry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Updated `wry`, fixing an issue with the draggable region.

core/tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ thiserror = "1.0.24"
2828
once_cell = "1.7.2"
2929
tauri-macros = { version = "1.0.0-beta-rc.0", path = "../tauri-macros" }
3030
tauri-utils = { version = "1.0.0-beta-rc.0", path = "../tauri-utils" }
31-
wry = "0.7"
31+
wry = "0.8"
3232
rand = "0.8"
3333
reqwest = { version = "0.11", features = [ "json", "multipart" ] }
3434
tempfile = "3"

core/tauri/src/runtime/flavors/wry.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ impl Dispatch for WryDispatcher {
273273
.add_window_with_configs(
274274
attributes,
275275
rpc_handler,
276-
custom_protocol.map(create_custom_protocol),
276+
custom_protocol
277+
.map(create_custom_protocol)
278+
.unwrap_or_default(),
277279
file_drop_handler,
278280
)
279281
.map_err(|_| crate::Error::CreateWebview)?;
@@ -480,7 +482,9 @@ impl Runtime for Wry {
480482
.add_window_with_configs(
481483
attributes,
482484
rpc_handler,
483-
custom_protocol.map(create_custom_protocol),
485+
custom_protocol
486+
.map(create_custom_protocol)
487+
.unwrap_or_default(),
484488
file_drop_handler,
485489
)
486490
.map_err(|_| crate::Error::CreateWebview)?;
@@ -540,11 +544,11 @@ fn create_file_drop_handler<M: Params<Runtime = Wry>>(
540544
}
541545

542546
/// Create a wry custom protocol from a tauri custom protocol.
543-
fn create_custom_protocol(custom_protocol: CustomProtocol) -> wry::CustomProtocol {
544-
wry::CustomProtocol {
547+
fn create_custom_protocol(custom_protocol: CustomProtocol) -> Vec<wry::CustomProtocol> {
548+
vec![wry::CustomProtocol {
545549
name: custom_protocol.name.clone(),
546550
handler: Box::new(move |data| {
547551
(custom_protocol.handler)(data).map_err(|_| wry::Error::InitScriptError)
548552
}),
549-
}
553+
}]
550554
}

0 commit comments

Comments
 (0)