Skip to content
Discussion options

You must be logged in to vote

in my experience it's easier to move an AppHandle into threads and tasks and use that to get the state on demand. In your case you already give start_upload an AppHandle instance (probably to emit events?), so just remove the state parameter and do something like this inside your start_upload function

start_upload(app_handle: AppHandle) {
  let state = app_handle.state::<MainState>();
  // ...
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@billywatkins
Comment options

Answer selected by billywatkins
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants