Skip to content

Commit

Permalink
(android) Prevent nav to scanner after successful payment
Browse files Browse the repository at this point in the history
This prevents an issue on lnurl-withdrawal where the app would
retyr a withdrawal again when moving back from the successful
payment splash window.
  • Loading branch information
dpad85 committed Feb 22, 2024
1 parent e3208e8 commit f385fc1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,16 @@ fun AppView(
if (paymentId != null) {
RequireStarted(walletState, nextUri = "phoenix:payments/${direction}/${id}") {
log.debug("navigating to payment-details id=$id")
val fromEvent = it.arguments?.getBoolean("fromEvent") ?: false
PaymentDetailsView(
paymentId = paymentId,
onBackClick = {
if (!navController.popBackStack()) {
val previousNav = navController.previousBackStackEntry
if (!navController.popBackStack() || (fromEvent && previousNav?.destination?.route == Screen.ScanData.route)) {
popToHome(navController)
}
},
fromEvent = it.arguments?.getBoolean("fromEvent") ?: false
fromEvent = fromEvent
)
}
}
Expand Down

0 comments on commit f385fc1

Please sign in to comment.