diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index e954c24385d3..fdd193a7c4ab 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -139,9 +139,6 @@ function IOURequestStepScan({ selector: transactionDraftValuesSelector, canBeMissing: true, }); - - const shouldPreventPhotoCapture = useRef(false); - const transactions = useMemo(() => { const allTransactions = optimisticTransactions && optimisticTransactions.length > 1 ? optimisticTransactions : [initialTransaction]; return allTransactions.filter((transaction): transaction is Transaction => !!transaction); @@ -791,20 +788,7 @@ function IOURequestStepScan({ }); }, []); - useEffect(() => { - if (!isTabActive) { - return; - } - shouldPreventPhotoCapture.current = false; - }, [isTabActive]); - const capturePhoto = useCallback(() => { - if (shouldPreventPhotoCapture.current) { - return; - } - if (!isMultiScanEnabled) { - shouldPreventPhotoCapture.current = true; - } if (trackRef.current && isFlashLightOn) { trackRef.current .applyConstraints({ @@ -820,7 +804,7 @@ function IOURequestStepScan({ } getScreenshot(); - }, [isFlashLightOn, getScreenshot, clearTorchConstraints, isMultiScanEnabled]); + }, [isFlashLightOn, getScreenshot, clearTorchConstraints]); const panResponder = useRef( PanResponder.create({