wwt / SwiftCurrent

A library for managing complex workflows in Swift

Home Page:https://wwt.github.io/SwiftCurrent/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Abandon does not dismiss SwiftUI Nav stack

Tyler-Keith-Thompson opened this issue · comments

What happened?

I've got a workflow set up with multiple items, I used the .embedInNavStack() fluent API, but when I call workflow?.abandon() the nav stack doesn't reset. I just stay on the last page.

Version

SwiftCurrent Version: 5.1.4
Xcode Version: 13.4.1
iOS Version: 14+

Relevant code sample

WorkflowView(launchingWith: .init(wrappedValue: appointment)) {
                WorkflowItem(FirstView.self)
                    .presentationType(.navigationLink)
                WorkflowItem(SecondView.self)
                    .presentationType(.navigationLink)
            }
            .embedInNavigationView()

// from inside SecondView
Button("Abandon") {
    workflow?.abandon()
}

Relevant log output

It seems that the body is being published. I suspect we need to listen to calls to `abandon` and then set all `isActive` flags to `false` inside of `WorkflowItemWrapper`

Code of Conduct

  • I agree to follow this project's Code of Conduct

Modals have a weirder behavior, the view vanishes but the modal stays up.

Also note: backUpInWorkflow does the right thing