Авторизация, нерабочий чат
This commit is contained in:
@@ -51,9 +51,12 @@ sealed class Screen(val route: String) {
|
||||
|
||||
@Composable
|
||||
fun AppNavigation(
|
||||
navController: NavHostController = rememberNavController(),
|
||||
startDestination: String = Screen.Login.route
|
||||
navController: NavHostController = rememberNavController()
|
||||
) {
|
||||
val authViewModel: AuthViewModel = hiltViewModel()
|
||||
val authState by authViewModel.state.collectAsState()
|
||||
val startDestination = if (authState.isAuthenticated) Screen.ChatList.route else Screen.Login.route
|
||||
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
val currentRoute = navBackStackEntry?.destination?.route
|
||||
|
||||
@@ -137,6 +140,7 @@ fun AppNavigation(
|
||||
val viewModel: ChatDetailViewModel = hiltViewModel()
|
||||
|
||||
ChatDetailScreen(
|
||||
chatId = chatId,
|
||||
chatName = chatName,
|
||||
viewModel = viewModel,
|
||||
onBack = { navController.popBackStack() }
|
||||
|
||||
Reference in New Issue
Block a user