fix(cash-in): restore cancel button and add displayingQR timeout

Cancel button is now always visible during the cash-in flow. The state
machine routes CANCEL to confirmAbandon when bills are present, so the
user always has an exit path with appropriate warnings. Also adds a
5-minute auto-timeout on displayingQR and allows cancel during
generatingNdebit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-02-25 20:19:01 -05:00
commit 0406a21b0e
2 changed files with 17 additions and 8 deletions

View file

@ -449,7 +449,6 @@ export function createATMMachine(
},
},
generatingNdebit: {
// No CANCEL here — bills are already in the cash box
invoke: {
src: 'generateNdebit',
input: ({ context }) => context,
@ -465,8 +464,14 @@ export function createATMMachine(
actions: 'setError',
},
},
on: {
CANCEL: 'confirmAbandon',
},
},
displayingQR: {
after: {
TIMEOUT_MS: 'confirmAbandon',
},
on: {
PAYMENT_RECEIVED: {
target: 'askForReceipt',