From cb580a39996afc4d435893f887db1689ac2175b6 Mon Sep 17 00:00:00 2001 From: Alka Date: Mon, 6 Nov 2023 15:04:36 +0530 Subject: [PATCH] fix(INJI-441): handle cancel button press during vc share Signed-off-by: Alka --- machines/bleShare/scan/scanMachine.ts | 6 ++++++ screens/Scan/ScanLayoutController.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/machines/bleShare/scan/scanMachine.ts b/machines/bleShare/scan/scanMachine.ts index 2dd02de7bf..9586c7e341 100644 --- a/machines/bleShare/scan/scanMachine.ts +++ b/machines/bleShare/scan/scanMachine.ts @@ -527,6 +527,12 @@ export const scanMachine = initial: 'inProgress', states: { inProgress: { + on: { + CANCEL: { + target: '#scan.reviewing.cancelling', + actions: ['sendVCShareFlowCancelEndEvent'], + }, + }, after: { SHARING_TIMEOUT: { target: '#scan.reviewing.sendingVc.timeout', diff --git a/screens/Scan/ScanLayoutController.ts b/screens/Scan/ScanLayoutController.ts index ac866c77ec..3137fa6555 100644 --- a/screens/Scan/ScanLayoutController.ts +++ b/screens/Scan/ScanLayoutController.ts @@ -110,6 +110,7 @@ export function useScanLayout() { statusOverlay = { title: t('status.inProgress'), progress: true, + onButtonPress: CANCEL, }; } else if (isConnectingTimeout) { statusOverlay = { @@ -144,6 +145,7 @@ export function useScanLayout() { title: t('status.sharing.title'), hint: t('status.sharing.hint'), progress: true, + onButtonPress: CANCEL, }; } else if (isSendingVcTimeout) { statusOverlay = {