fix: navigate to send confirmation broken when already on idle send screen

This commit is contained in:
2026-06-05 20:08:18 +02:00
parent 946ed8abcb
commit f53e512edf
2 changed files with 20 additions and 7 deletions
@@ -223,7 +223,14 @@ fun WalletScreen(
contentAlignment = Alignment.Center
) {
FilledIconButton(
onClick = { navController.navigate(ROUTE_SCANNER) },
onClick = {
navController.navigate(ROUTE_SCANNER) {
popUpTo(TabItem.Send.route) {
saveState = true
inclusive = false
}
}
},
modifier = Modifier.size(52.dp),
shape = CircleShape
) {
@@ -310,10 +317,17 @@ fun WalletScreen(
composable(ROUTE_SCANNER) {
QrScannerScreen(
onScanned = { scanned ->
navController.popBackStack()
vm.scan(scanned)
navController.navigate(TabItem.Send.route) {
launchSingleTop = true
val wentBack = navController.popBackStack(TabItem.Send.route, inclusive = false)
if (!wentBack) {
// Scan was triggered from a non-Send tab — navigate to Send
navController.navigate(TabItem.Send.route) {
popUpTo(navController.graph.findStartDestination().id) {
saveState = true
}
launchSingleTop = true
restoreState = false // don't restore old Idle state; VM already has new state
}
}
},
onDismiss = { navController.popBackStack() }