Skip to content

Commit

Permalink
fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Aug 17, 2024
1 parent 862fdc0 commit 46443e4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .changes/update-tauri-rc-3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
"geolocation": patch
"deep-link": patch
"updater": patch
---

Update to tauri 2.0.0-rc.3.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions plugins/deep-link/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn init_deep_link<R: Runtime, C: DeserializeOwned>(
#[cfg(target_os = "android")]
{
use tauri::{
ipc::{Channel, InvokeBody},
ipc::{Channel, InvokeResponseBody},
Emitter,
};

Expand All @@ -35,13 +35,14 @@ fn init_deep_link<R: Runtime, C: DeserializeOwned>(
"setEventHandler",
imp::EventHandler {
handler: Channel::new(move |event| {
println!("got channel event: {:?}", &event);

let url = match event {
InvokeBody::Json(payload) => payload
.get("url")
.and_then(|v| v.as_str())
.map(|s| s.to_owned()),
InvokeResponseBody::Json(payload) => serde_json::from_str(&payload)
.and_then(|payload| {
payload
.get("url")
.and_then(|v| v.as_str())
.map(|s| s.to_owned())
}),
_ => None,
};

Expand Down
4 changes: 2 additions & 2 deletions plugins/geolocation/src/mobile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use serde::{de::DeserializeOwned, Serialize};
use tauri::{
ipc::{Channel, InvokeBody},
ipc::{Channel, InvokeResponseBody},
plugin::{PluginApi, PluginHandle},
AppHandle, Runtime,
};
Expand Down Expand Up @@ -51,7 +51,7 @@ impl<R: Runtime> Geolocation<R> {
) -> crate::Result<u32> {
let channel = Channel::new(move |event| {
let payload = match event {
InvokeBody::Json(payload) => serde_json::from_value::<WatchEvent>(dbg!(payload))
InvokeResponseBody::Json(payload) => serde_json::from_str::<WatchEvent>(&payload)
.unwrap_or_else(|error| {
WatchEvent::Error(format!(
"Couldn't deserialize watch event payload: `{error}`"
Expand Down
3 changes: 2 additions & 1 deletion plugins/updater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ infer = "0.15"

[target."cfg(target_os = \"windows\")".dependencies]
zip = { version = "2", default-features = false, optional = true }
windows-sys = { version = "0.52.0", features = [
windows-sys = { version = "0.59.0", features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
"Win32_UI_Shell",
] }

[target."cfg(target_os = \"linux\")".dependencies]
Expand Down
2 changes: 1 addition & 1 deletion plugins/updater/src/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ impl Update {

unsafe {
ShellExecuteW(
0,
std::ptr::null_mut(),
w!("open"),
file.as_ptr(),
parameters.as_ptr(),
Expand Down

0 comments on commit 46443e4

Please sign in to comment.