Skip to content

Commit ee1df6f

Browse files
committed
chore(flipcash): move authState check into LaunchedEffect and out of loginRequest storing
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent c051ce7 commit ee1df6f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui

apps/flipcash/app/src/main/kotlin/com/flipcash/app/internal/ui/App.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ internal fun App(
9090
val userManager = LocalUserManager.currentOrThrow
9191
DeepLinkListener {
9292
val type = router.processType(it)
93-
if (type is DeeplinkType.Login && userManager.authState is AuthState.LoggedIn) {
93+
if (type is DeeplinkType.Login) {
9494
loginRequest = type.entropy
9595
return@DeepLinkListener
9696
}
@@ -164,8 +164,9 @@ internal fun App(
164164
}
165165
}
166166

167-
LaunchedEffect(loginRequest, codeNavigator.lastItem) {
167+
LaunchedEffect(loginRequest, codeNavigator.lastItem, userManager.authState) {
168168
if (codeNavigator.lastItem is MainRoot) return@LaunchedEffect
169+
if (userManager.authState !is AuthState.LoggedIn) return@LaunchedEffect
169170
loginRequest?.let { entropy ->
170171
viewModel.handleLoginEntropy(
171172
entropy,

0 commit comments

Comments
 (0)