this PR is more to request feedback on how it should be done, rather than think this is better than the original.
Things I saw:
main() was using tokio and a thread, where one of the two would do?
it was doing a background scan once a second, so the button wasn't very useful
I added a state Scanning, which changes the button text to show that (I would like to disable the button also)
But mainly, it looked to me like the scan coroutine just received the state from the receiver, and didn't do a scan, so scan.start() didn't actually do a new scan.
I couldn't get it working using co-routines, so did the thread thing in the button on_click(), but I would like to know how a background/async task like that should be triggered from a UI Button...
this PR is more to request feedback on how it should be done, rather than think this is better than the original.
Things I saw:
But mainly, it looked to me like the
scan
coroutine just received the state from the receiver, and didn't do a scan, so scan.start() didn't actually do a new scan.I couldn't get it working using co-routines, so did the thread thing in the button on_click(), but I would like to know how a background/async task like that should be triggered from a UI Button...