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]: navigate to an empty view under conditional flow

dulllight opened this issue · comments

Navigate to an empty view under conditional flow with presentation type of navigationLink

Hi, Today I notice a strange behavior. In screen A, there is a toggle. If toggle is on, press "Next", it would lead to screen B. If off, to screen C. If the presentationTyp is navigationLink or modal, when toggle is off, if press "Next", it would not lead to screen C
but an empty view. Would you please help check what might cause this issue? Many thanks.

Version

SwiftCurrent 5.1.5
Xcode 13.3.1

Relevant code sample

WorkflowView(launchingWith: model) {
    WorkflowItem(FirstView.self)  // toggle inside
        .presentationType(.navigationLink)
    WorkflowItem(SecondView.self) //  when toggle is on, it would lead to here
        .presentationType(.navigationLink)
    WorkflowItem(ThridView.self) // when toggle is off, it would lead to here
        .presentationType(.navigationLink)
    WorkflowItem(FourthView.self)
        .presentationType(.navigationLink)
    WorkflowItem(FifthView.self)
        .presentationType(.navigationLink)
)

Relevant log output

No response

Code of Conduct

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

I'll look into reproducing this, while I do is your WorkflowView inside a NavigationView?

SCRepro.zip

I was able to reproduce the issue. I'll look into a fix, but I'm posting the reproduction in case somebody else can get to it faster.

Alright! The branch fix-209 has the correct behavior. I still need to get tests updated and fix a couple pipeline things before I can release.

Fixed in 5.1.6