We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22114fe commit 188468aCopy full SHA for 188468a
1 file changed
app/src/main/java/com/cornellappdev/uplift/ui/viewmodels/nav/RootNavigationViewModel.kt
@@ -67,11 +67,19 @@ class RootNavigationViewModel @Inject constructor(
67
val hasSkipped = userInfoRepository.getSkipFromDataStore()
68
val shouldShowHome = loggedIn || hasSkipped || !ONBOARDING_FLAG
69
val newRoute = if (shouldShowHome) UpliftRootRoute.Home else UpliftRootRoute.Onboarding
70
- applyMutation {
71
- copy(
72
- startDestination = newRoute,
73
- navEvent = UIEvent(newRoute)
74
- )
+ if (newRoute != uiStateFlow.value.startDestination || loggedIn != uiStateFlow.value.isLoggedIn) {
+ applyMutation {
+ copy(
+ isLoggedIn = loggedIn,
+ startDestination = newRoute,
75
+ navEvent = UIEvent(newRoute)
76
+ )
77
+ }
78
79
+ else {
80
81
+ copy(isLoggedIn = loggedIn)
82
83
}
84
85
0 commit comments