Relaunching a workflow using onChange
Tyler-Keith-Thompson opened this issue · comments
Describe the bug
If you use the onChange
modifier of a view to listen to when a workflow is no longer launched, then relaunch that way instead of with a .constant(true)
, the workflow just vanishes.
To Reproduce
Steps to reproduce the behavior: ALL CHANGES TO CONTENTVIEW
- In our sample app, modify the profile workflow to have a
@State
variable that binds it instead of.constant(true)
- Add an
onChange(of: profileWorkflowShown) { if !$0 { profileWorkflowShown = true } }
modified to theTabView
, or wherever, it doesn't matter. - Notice that profile simply vanishes and never really re-appears.
Expected behavior
The workflow should relaunch, just as if you were using .constant(true)
Screenshots
You want a screenshot of nothing? Heh, no
Actually, our getting started example showcases this. Once you finish, it does not relaunch.
We seemed to have narrowed this down to in the ModifiedWorkflowView
's body that the .onChange(of: isLaunched)
is not getting called to launch the workflow again.
We think that part of it might have to do with either the isLaunched
check previously or the check of if let body = model.body as? Content