diff --git a/examples/helloworld/package.json b/examples/helloworld/package.json index 2c6fd20..8720e00 100644 --- a/examples/helloworld/package.json +++ b/examples/helloworld/package.json @@ -11,7 +11,7 @@ "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "^2.1.1", + "@tauri-apps/api": "^2.7.0", "@aptabase/tauri": "file:../../" }, "devDependencies": { diff --git a/package.json b/package.json index 2c16439..ff0a2f6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "typescript": "^5.7.2" }, "dependencies": { - "@tauri-apps/api": "^2.1.1", + "@tauri-apps/api": "^2.7.0", "tslib": "^2.8.1" } } diff --git a/src/client.rs b/src/client.rs index da9d905..5a2ffd7 100644 --- a/src/client.rs +++ b/src/client.rs @@ -75,7 +75,7 @@ impl AptabaseClient { pub(crate) fn start_polling(&self, interval: Duration) { let dispatcher = self.dispatcher.clone(); - tokio::spawn(async move { + tauri::async_runtime::spawn(async move { loop { tokio::time::sleep(interval).await; dispatcher.flush().await; diff --git a/src/lib.rs b/src/lib.rs index a2b747c..824a794 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ mod config; mod dispatcher; mod sys; -use std::{panic::PanicInfo, sync::Arc, time::Duration}; +use std::{panic::PanicHookInfo, sync::Arc, time::Duration}; use client::AptabaseClient; use config::Config; @@ -28,9 +28,9 @@ pub struct Builder { } pub type PanicHook = - Box, String) + 'static + Sync + Send>; + Box, String) + 'static + Sync + Send>; -fn get_panic_message(info: &PanicInfo) -> String { +fn get_panic_message(info: &PanicHookInfo) -> String { let payload = info.payload(); if let Some(s) = payload.downcast_ref::<&str>() { return s.to_string();