Closed zardasht-jazaa closed 8 months ago
Auth.auth().addStateDidChangeListener { [weak self] (_, user) in
guard let self = self, let user = user else { return }
let userInterestDocRef = self.userInterestCollection.document(user.uid)
userInterestDocRef.getDocument { (document, error) in
if let document = document, document.exists {
completion()
} else {
let userInterest = UsersInterestModel(userId: user.uid)
self.userId = user.uid
do {
try userInterestDocRef.setData(from: userInterest)
completion()
} catch {
print("Error Writing userData to FireStore: \(error.localizedDescription)")
}
@ViewBuilder private var footerView: some View {
The8Button(buttonText: "Continue", buttonStyleType: interestViewModel.isUserInterestMoreThanThree ? .vibrantRed : .filledDisabled) {
interestViewModel.storeSelectedInterestToFireStore { result in
switch result {
case .success(()):
isPreferenceSelected = true
if isPreferenceSelected {
router.navigate(to: .homeView(theEightHeaderViewModel))
}
case .failure(let error):
debugPrint("error is: \(error.localizedDescription)")
}
}
}
.padding(.horizontal)
.disabled(!interestViewModel.isUserInterestMoreThanThree)
}
Hello, I have an issue with Router Stack array , I just add an print for the RoutingView public struct RoutingView<RootView: View, Routes: Routable>: View but I see in the terminal it print constantly , and at the same time I have another issue with navigating to root , for example when the User Is Logout I navigate them to root View , but when user is back to root View , then repeat the process the function of addToStack is called multiple time when an navigation happen.
this is called multiple time after back to root is called and stack get empty.
https://github.com/JamesSedlacek/Routing/assets/141743367/3a689d6d-54b8-4954-b7aa-1153d0204644