Fix bunch of issues around login/logout and introduces messages feature
This commit is contained in:
parent
b5e4ef9637
commit
d04d847521
19 changed files with 314 additions and 89 deletions
|
|
@ -33,7 +33,12 @@ private fun MainScreen(viewModel: MainViewModel) {
|
|||
val engine = rememberNavHostEngine()
|
||||
val navController = engine.rememberNavController()
|
||||
val startRoute = runBlocking {
|
||||
if (!viewModel.hasSession()) LoginScreenNavigationDestination else NavGraphs.root.startRoute
|
||||
if (!viewModel.isLoggedIn()) {
|
||||
LoginScreenNavigationDestination
|
||||
} else {
|
||||
viewModel.restoreSession()
|
||||
NavGraphs.root.startRoute
|
||||
}
|
||||
}
|
||||
|
||||
DestinationsNavHost(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue