diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt index f767d3cc0..5a9e472e2 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferNavHost.kt @@ -31,7 +31,11 @@ import com.infomaniak.swisstransfer.ui.screen.newtransfer.upload.UploadSuccessSc import com.infomaniak.swisstransfer.ui.screen.newtransfer.validateemail.ValidateUserEmailScreen @Composable -fun NewTransferNavHost(navController: NavHostController, closeActivity: () -> Unit) { +fun NewTransferNavHost( + navController: NavHostController, + closeActivity: () -> Unit, + closeActivityAndPromptForValidation: () -> Unit, +) { NavHost(navController, NewTransferNavigation.startDestination) { composable { @@ -48,7 +52,7 @@ fun NewTransferNavHost(navController: NavHostController, closeActivity: () -> Un composable { val args = it.toRoute() ValidateUserEmailScreen( - closeActivity = closeActivity, + closeActivity = closeActivityAndPromptForValidation, navigateBack = { navController.popBackStack() }, emailToValidate = args.userEmail, ) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt index 14e5d4f2c..c8c2811fc 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/NewTransferScreen.kt @@ -36,7 +36,11 @@ fun NewTransferScreen(closeActivity: () -> Unit) { val navController = rememberNavController() var displayConfirmationDialog by rememberSaveable { mutableStateOf(false) } - NewTransferNavHost(navController, closeActivity = { displayConfirmationDialog = true }) + NewTransferNavHost( + navController, + closeActivity = closeActivity, + closeActivityAndPromptForValidation = { displayConfirmationDialog = true }, + ) if (displayConfirmationDialog) ConfirmLeavingDialog(onLeave = closeActivity, onCancel = { displayConfirmationDialog = false }) }