Turn off app authentication for easier tests
This commit is contained in:
@@ -51,22 +51,24 @@ internal fun resolveRootRoute(
|
|||||||
@Preview
|
@Preview
|
||||||
fun App() {
|
fun App() {
|
||||||
RecipeTheme {
|
RecipeTheme {
|
||||||
val authSession = koinInject<AuthSession>()
|
// val authSession = koinInject<AuthSession>()
|
||||||
val userRepository = koinInject<UserRepository>()
|
// val userRepository = koinInject<UserRepository>()
|
||||||
val authState by authSession.state.collectAsStateWithLifecycle()
|
// val authState by authSession.state.collectAsStateWithLifecycle()
|
||||||
val currentUser by userRepository.currentUser.collectAsStateWithLifecycle()
|
// val currentUser by userRepository.currentUser.collectAsStateWithLifecycle()
|
||||||
|
//
|
||||||
// Kick off the persisted-session restore once. AuthSession.initialize()
|
// // Kick off the persisted-session restore once. AuthSession.initialize()
|
||||||
// refreshes the stored AuthState (or transitions to Unauthenticated on
|
// // refreshes the stored AuthState (or transitions to Unauthenticated on
|
||||||
// empty store / refresh failure) and the gate below recomposes accordingly.
|
// // empty store / refresh failure) and the gate below recomposes accordingly.
|
||||||
LaunchedEffect(authSession) {
|
// LaunchedEffect(authSession) {
|
||||||
authSession.initialize()
|
// authSession.initialize()
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
when (resolveRootRoute(authState, hasCurrentUser = currentUser != null)) {
|
// when (resolveRootRoute(authState, hasCurrentUser = currentUser != null)) {
|
||||||
RootRoute.Splash -> SplashScreen()
|
// RootRoute.Splash -> SplashScreen()
|
||||||
RootRoute.Login -> LoginScreen(viewModel = koinViewModel<LoginViewModel>())
|
// RootRoute.Login -> LoginScreen(viewModel = koinViewModel<LoginViewModel>())
|
||||||
RootRoute.Shell -> AppShell()
|
// RootRoute.Shell -> AppShell()
|
||||||
}
|
// }
|
||||||
|
//for easier tests authentication is turned off
|
||||||
|
AppShell()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user