Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push doesn't work if app is backgrounded and aware of scenePhase #73

Open
mustafaozhan opened this issue Apr 22, 2022 · 0 comments
Open

Comments

@mustafaozhan
Copy link
Contributor

mustafaozhan commented Apr 22, 2022

Hello 👋

I discovered a weird bug that nativation was not working after user,

  • open the app
  • background it
  • open again
  • then non of the progromatic push in entire project is not working
struct SliderView: View {
    @EnvironmentObject private var navigationStack: NavigationStack
    
    var body: some View {
    ...
			navigationStack.push(SomeView()) // not working
    ...
    }   
}

and I fix the bug by removing this @Environment(\.scenePhase) var scenePhase where NavigationStackView is located

struct MainView: View {

    @StateObject var observable: MainObservable = koin.get()

    @Environment(\.scenePhase) var scenePhase // this line is removed and bug is fixed

    var body: some View {

        NavigationStackView(
            transitionType: .default,
            easing: Animation.easeInOut(duration: 0.5)
        ) {
				....
        }
    }
}

I do not need any more scenePhase so it is not a blocker for me, but i thought it will be good to make you aware of this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant