Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -313,6 +317,7 @@ function AcuantCapture(
errorMessage,
name,
showSelfieHelp,
isReviewStep,
}: AcuantCaptureProps,
ref: Ref<HTMLInputElement | null>,
) {
Expand All @@ -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<FullScreenRefHandle>(null);
const inputRef = useRef<HTMLInputElement>(null);
const isForceUploading = useRef(false);
Expand All @@ -350,7 +355,7 @@ function AcuantCapture(
const isBackOfId = name === 'back';
useLogCameraInfo({ isBackOfId, hasStartedCropping });
const [isCapturingEnvironment, setIsCapturingEnvironment] = useState(
selfieCapture && immediatelyBeginCapture,
selfieCapture && !isReviewStep,
Comment thread
AShukla-GSA marked this conversation as resolved.
);

const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function DocumentSideAcuantCapture({
className={className}
allowUpload={isUploadAllowed}
showSelfieHelp={showSelfieHelp}
isReviewStep={isReviewStep}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SelfieCaptureProps>({
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: true,
immediatelyBeginCapture: false,
});

SelfieCaptureContext.displayName = 'SelfieCaptureContext';
Expand Down
1 change: 0 additions & 1 deletion app/javascript/packs/document-capture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ render(
isSelfieCaptureEnabled: getSelfieCaptureEnabled(),
isSelfieDesktopTestMode: String(docAuthSelfieDesktopTestMode) === 'true',
showHelpInitially: true,
immediatelyBeginCapture: false,
}}
>
<FailedCaptureAttemptsContextProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -50,7 +49,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -77,7 +75,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -100,7 +97,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -127,7 +123,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand Down Expand Up @@ -156,7 +151,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand Down Expand Up @@ -193,7 +187,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ describe('document-capture/components/documents-step', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: false,
showHelpInitially: true,
immediatelyBeginCapture: true,
}}
>
<DocumentsStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ describe('document-capture/components/selfie-step', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<SelfieStep
Expand Down Expand Up @@ -76,7 +75,6 @@ describe('document-capture/components/selfie-step', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<SelfieStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('document-capture/context/selfie-capture', () => {
'isSelfieCaptureEnabled',
'isSelfieDesktopTestMode',
'showHelpInitially',
'immediatelyBeginCapture',
]);
expect(result.current.isSelfieCaptureEnabled).to.be.a('boolean');
});
Expand Down