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

Callback navigation sometimes doesnt work #79

Open
cmason9 opened this issue Sep 2, 2022 · 1 comment
Open

Callback navigation sometimes doesnt work #79

cmason9 opened this issue Sep 2, 2022 · 1 comment

Comments

@cmason9
Copy link

cmason9 commented Sep 2, 2022

Hi I have implemented this library and it works great for my app for the most part. I have implemented a registration flow were the user goes through certain steps and moves to the next page. I have noticed that for when creating an account first time everything works as it should. But if i log out or kill the app and try to create a second account on a callback function i hit the self.navigation.push okay but the screen does not move the user forward. Here is the code below:

                        Button(action: {
                            viewModel.isLoading = true
                            viewModel.signUp(firstName: viewModel.firstName, lastName: viewModel.lastName, onCompletion: { result in
                                switch result {
                                case true:
                                    print("Go to verify page")
                                    if viewModel.showVerifyEmail {
                                        DispatchQueue.main.async {
                                            self.navigationStack.push(VerifyEmailView(authHandler: authHandler, apiHandler: apiHandler, verifying: true, emailAddress: viewModel.email.lowercased(), firstName: viewModel.firstName, lastName: viewModel.lastName, userExists: viewModel.userExists))
                                        }
                                    }
                                case false:
                                    if viewModel.goBack {
                                        DispatchQueue.main.async {
                                            self.navigationStack.pop()
                                        }
                                    }
                                }
                            })
                        }) {
                            PrimaryButtonMed(btnTitle: "create_account", isLoading: $viewModel.isLoading)
                        }
                        .opacity(viewModel.enableButton(firstName: viewModel.firstName, lastName: viewModel.lastName) ? 1 : 0.6)
                        .disabled(!viewModel.enableButton(firstName: viewModel.firstName, lastName: viewModel.lastName))
                    }
                    .padding(.trailing, 10)

Any help of suggestions is greatly appreciated.

Thanks

@petrosibm
Copy link

Is there any update on this issue? To my experience it is the basic problem of this project. Other than that, it is doing great.

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

2 participants