@@ -52,6 +52,7 @@ import androidx.compose.ui.graphics.Color
5252import androidx.compose.ui.platform.LocalContext
5353import androidx.compose.ui.text.style.TextAlign
5454import androidx.compose.ui.unit.dp
55+ import androidx.navigation.NavGraph.Companion.findStartDestination
5556import androidx.navigation.compose.NavHost
5657import androidx.navigation.compose.composable
5758import androidx.navigation.compose.rememberNavController
@@ -543,7 +544,7 @@ fun FirebaseAuthScreen(
543544
544545 if (currentRoute != AuthRoute .Success .route) {
545546 navController.navigate(AuthRoute .Success .route) {
546- popUpTo(AuthRoute . MethodPicker .route ) { inclusive = true }
547+ popUpTo(navController.graph.findStartDestination().id ) { inclusive = true }
547548 launchSingleTop = true
548549 }
549550 }
@@ -556,7 +557,7 @@ fun FirebaseAuthScreen(
556557 pendingLinkingCredential.value = null
557558 if (currentRoute != AuthRoute .Success .route) {
558559 navController.navigate(AuthRoute .Success .route) {
559- popUpTo(AuthRoute . MethodPicker .route ) { inclusive = true }
560+ popUpTo(navController.graph.findStartDestination().id ) { inclusive = true }
560561 launchSingleTop = true
561562 }
562563 }
@@ -575,9 +576,9 @@ fun FirebaseAuthScreen(
575576 pendingResolver.value = null
576577 pendingLinkingCredential.value = null
577578 lastSuccessfulUserId.value = null
578- if (currentRoute != AuthRoute . MethodPicker .route) {
579- navController.navigate(AuthRoute . MethodPicker .route) {
580- popUpTo(AuthRoute . MethodPicker .route ) { inclusive = true }
579+ if (currentRoute != startRoute .route) {
580+ navController.navigate(startRoute .route) {
581+ popUpTo(navController.graph.findStartDestination().id ) { inclusive = true }
581582 launchSingleTop = true
582583 }
583584 }
@@ -588,9 +589,9 @@ fun FirebaseAuthScreen(
588589 pendingResolver.value = null
589590 pendingLinkingCredential.value = null
590591 lastSuccessfulUserId.value = null
591- if (currentRoute != AuthRoute . MethodPicker .route) {
592- navController.navigate(AuthRoute . MethodPicker .route) {
593- popUpTo(AuthRoute . MethodPicker .route ) { inclusive = true }
592+ if (currentRoute != startRoute .route) {
593+ navController.navigate(startRoute .route) {
594+ popUpTo(navController.graph.findStartDestination().id ) { inclusive = true }
594595 launchSingleTop = true
595596 }
596597 }
0 commit comments