From 47ad1d750067299429304968c19e20ad9ec7012c Mon Sep 17 00:00:00 2001 From: "truph01 (via MelvinBot)" Date: Tue, 10 Mar 2026 18:32:44 +0000 Subject: [PATCH] Fix: pass backTo to Navigation.goBack() in native IOURequestStepScan navigateBack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The native navigateBack() was not passing the backTo parameter to Navigation.goBack(), unlike the web version. This caused incorrect navigation when replacing a receipt — pressing back after capturing a photo returned to the camera screen instead of the previous screen. Co-authored-by: truph01 --- .../iou/request/step/IOURequestStepScan/index.native.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index c2044a833ed52..8d06ed7bbe773 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -77,9 +77,9 @@ function IOURequestStepScan({ // Format dimensions are in landscape orientation, so height/width gives portrait aspect ratio const cameraAspectRatio = format ? format.photoHeight / format.photoWidth : undefined; - const navigateBack = () => { - Navigation.goBack(); - }; + const navigateBack = useCallback(() => { + Navigation.goBack(backTo); + }, [backTo]); const hasFlash = !!device?.hasFlash; const camera = useRef(null); const [flash, setFlash] = useState(false); @@ -268,7 +268,7 @@ function IOURequestStepScan({ } replaceReceipt({transactionID: initialTransactionID, file: file as File, source, transactionPolicy: policy, transactionPolicyCategories: policyCategories}); }, - [initialTransactionID, policy, policyCategories, backTo], + [initialTransactionID, policy, policyCategories, backTo, navigateBack], ); const getSource = useCallback((file: FileObject) => file.uri ?? '', []);