diff --git a/app/javascript/packages/document-capture/components/acuant-capture.tsx b/app/javascript/packages/document-capture/components/acuant-capture.tsx index 33c6109b64a..c481d7b0949 100644 --- a/app/javascript/packages/document-capture/components/acuant-capture.tsx +++ b/app/javascript/packages/document-capture/components/acuant-capture.tsx @@ -136,6 +136,10 @@ interface AcuantCaptureProps { * Determine whether the selfie help text shoule be shown. */ showSelfieHelp: () => void; + /** + * Whether user is on the failed submission review step + */ + isReviewStep?: boolean; } /** @@ -313,6 +317,7 @@ function AcuantCapture( errorMessage, name, showSelfieHelp, + isReviewStep, }: AcuantCaptureProps, ref: Ref, ) { @@ -327,7 +332,7 @@ function AcuantCapture( } = useContext(AcuantContext); const { isMockClient } = useContext(UploadContext); const { trackEvent } = useContext(AnalyticsContext); - const { isSelfieCaptureEnabled, immediatelyBeginCapture } = useContext(SelfieCaptureContext); + const { isSelfieCaptureEnabled } = useContext(SelfieCaptureContext); const fullScreenRef = useRef(null); const inputRef = useRef(null); const isForceUploading = useRef(false); @@ -350,7 +355,7 @@ function AcuantCapture( const isBackOfId = name === 'back'; useLogCameraInfo({ isBackOfId, hasStartedCropping }); const [isCapturingEnvironment, setIsCapturingEnvironment] = useState( - selfieCapture && immediatelyBeginCapture, + selfieCapture && !isReviewStep, ); const { diff --git a/app/javascript/packages/document-capture/components/document-side-acuant-capture.tsx b/app/javascript/packages/document-capture/components/document-side-acuant-capture.tsx index 5325d1ee36c..4c027f45fa5 100644 --- a/app/javascript/packages/document-capture/components/document-side-acuant-capture.tsx +++ b/app/javascript/packages/document-capture/components/document-side-acuant-capture.tsx @@ -100,6 +100,7 @@ function DocumentSideAcuantCapture({ className={className} allowUpload={isUploadAllowed} showSelfieHelp={showSelfieHelp} + isReviewStep={isReviewStep} /> ); } diff --git a/app/javascript/packages/document-capture/context/selfie-capture.tsx b/app/javascript/packages/document-capture/context/selfie-capture.tsx index 6115ccd7f48..76b30704cf0 100644 --- a/app/javascript/packages/document-capture/context/selfie-capture.tsx +++ b/app/javascript/packages/document-capture/context/selfie-capture.tsx @@ -14,17 +14,12 @@ interface SelfieCaptureProps { * the capture component. */ showHelpInitially: boolean; - /** - * Specify whether we should try to capture using Acuant immediately - */ - immediatelyBeginCapture: boolean; } const SelfieCaptureContext = createContext({ isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: false, showHelpInitially: true, - immediatelyBeginCapture: false, }); SelfieCaptureContext.displayName = 'SelfieCaptureContext'; diff --git a/app/javascript/packs/document-capture.tsx b/app/javascript/packs/document-capture.tsx index 44a49401423..28e24ecd08f 100644 --- a/app/javascript/packs/document-capture.tsx +++ b/app/javascript/packs/document-capture.tsx @@ -179,7 +179,6 @@ render( isSelfieCaptureEnabled: getSelfieCaptureEnabled(), isSelfieDesktopTestMode: String(docAuthSelfieDesktopTestMode) === 'true', showHelpInitially: true, - immediatelyBeginCapture: false, }} > { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: false, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -50,7 +49,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: true, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -77,7 +75,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: false, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -100,7 +97,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: true, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -127,7 +123,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: true, isSelfieDesktopTestMode: false, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -156,7 +151,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: true, isSelfieDesktopTestMode: true, showHelpInitially: false, - immediatelyBeginCapture: false, }} > @@ -193,7 +187,6 @@ describe('DocumentSideAcuantCapture', () => { isSelfieCaptureEnabled: true, isSelfieDesktopTestMode: true, showHelpInitially: false, - immediatelyBeginCapture: false, }} > diff --git a/spec/javascript/packages/document-capture/components/documents-step-spec.tsx b/spec/javascript/packages/document-capture/components/documents-step-spec.tsx index 80bedd1160f..225f9573800 100644 --- a/spec/javascript/packages/document-capture/components/documents-step-spec.tsx +++ b/spec/javascript/packages/document-capture/components/documents-step-spec.tsx @@ -148,7 +148,6 @@ describe('document-capture/components/documents-step', () => { isSelfieCaptureEnabled: true, isSelfieDesktopTestMode: false, showHelpInitially: true, - immediatelyBeginCapture: true, }} > { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: false, showHelpInitially: false, - immediatelyBeginCapture: false, }} > { isSelfieCaptureEnabled: false, isSelfieDesktopTestMode: false, showHelpInitially: false, - immediatelyBeginCapture: false, }} > { 'isSelfieCaptureEnabled', 'isSelfieDesktopTestMode', 'showHelpInitially', - 'immediatelyBeginCapture', ]); expect(result.current.isSelfieCaptureEnabled).to.be.a('boolean'); });