You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use tauri::{Builder,GlobalWindowEvent,Manager};
....
// In an event handler:
fn on_window_event(event:GlobalWindowEvent){// Get a handle to the app so we can get the global state.let app_handle = event.window().app_handle();let state = app_handle.state::<Mutex<AppState>>();// Lock the mutex to mutably access the state.letmut state = state.lock().unwrap();
state.counter += 1;}
But, as far as I can see, GlobalWindowEvent on v2 does not exist, instead we have WindowEvent, which does not give you access to the underlying window()?
Docs reference using GlobalWindowEvent
But, as far as I can see, GlobalWindowEvent on v2 does not exist, instead we have WindowEvent, which does not give you access to the underlying window()?
https://v2.tauri.app/develop/state-management/#accessing-state
The text was updated successfully, but these errors were encountered: