@@ -42,6 +42,7 @@ import androidx.navigation.NavController
4242import androidx.navigation.navOptions
4343import com.dimension.maskbook.common.bigDecimal.BigDecimal
4444import com.dimension.maskbook.common.ext.decodeBase64
45+ import com.dimension.maskbook.common.ext.navigateWithPopSelf
4546import com.dimension.maskbook.common.ext.observeAsState
4647import com.dimension.maskbook.common.ext.openUrl
4748import com.dimension.maskbook.common.ext.shareText
@@ -599,7 +600,7 @@ internal fun navigateWalletCreate(
599600) {
600601 val route = if (shouldShowLegalScene) {
601602 WalletRoute .WalletIntroHostLegal (type.name)
602- } else if (password.isNullOrEmpty ()) {
603+ } else if (password.isEmpty ()) {
603604 WalletRoute .WalletIntroHostPassword (type.name)
604605 } else if (! enableBiometric && biometricEnableViewModel.isSupported(context) && wallets.isEmpty()) {
605606 WalletRoute .WalletIntroHostFaceId (type.name)
@@ -608,12 +609,6 @@ internal fun navigateWalletCreate(
608609 }
609610 navController.navigate(
610611 route,
611- navOptions {
612- navController.currentDestination?.id?.let { popId ->
613- popUpTo(popId) { inclusive = true }
614- }
615- launchSingleTop = true
616- }
617612 )
618613}
619614
@@ -647,15 +642,15 @@ fun WalletIntroHostLegal(
647642 } else {
648643 WalletRoute .CreateOrImportWallet (type.name)
649644 }
650- navController.navigate(
651- route,
652- navOptions {
653- navController.currentDestination?.id?. let { popId ->
654- popUpTo(popId) { inclusive = true }
655- }
656- launchSingleTop = true
657- }
658- )
645+ if (password.isNullOrEmpty()) {
646+ navController.navigate(
647+ route,
648+ )
649+ } else {
650+ navController.navigateWithPopSelf(
651+ route,
652+ )
653+ }
659654 },
660655 onBrowseAgreement = {
661656 context.startActivity(
@@ -687,9 +682,9 @@ fun WalletIntroHostPassword(
687682 SetUpPaymentPassword (
688683 onNext = {
689684 if (! enableBiometric && biometricEnableViewModel.isSupported(context) && wallets.isEmpty()) {
690- navController.navigate (WalletRoute .WalletIntroHostFaceId (type.name))
685+ navController.navigateWithPopSelf (WalletRoute .WalletIntroHostFaceId (type.name))
691686 } else {
692- navController.navigate (WalletRoute .CreateOrImportWallet (type.name))
687+ navController.navigateWithPopSelf (WalletRoute .CreateOrImportWallet (type.name))
693688 }
694689 }
695690 )
0 commit comments