johnpatrickmorgan / FlowStacks

FlowStacks allows you to hoist SwiftUI navigation and presentation state into a Coordinator
MIT License
783 stars 56 forks source link

Fix issue publishing route changes off main thread #31

Closed ConfusedVorlon closed 2 years ago

ConfusedVorlon commented 2 years ago

withDelaysIfUnsupported (line 112) needs to run on the main thread as it publishes changes to routes.

Although it is called from a Task{@MainActor...) , that doesn't guarantee that it is run on MainActor as it is called async-ly

I'm getting purple runtime errors at the moment, and this fixes them!

johnpatrickmorgan commented 2 years ago

Thanks @ConfusedVorlon - I'm still getting used to the new concurrency stuff!

ConfusedVorlon commented 2 years ago

thanks for the rapid merge.

I wish there was better docs on this stuff - I keep hitting unexpected behaviour...