Skip to content

Commit

Permalink
remove immediatelyBeginCapture from selfie context
Browse files Browse the repository at this point in the history
  • Loading branch information
theabrad committed Dec 18, 2024
1 parent c667986 commit 28a9b1b
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,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 @@ -349,9 +349,7 @@ function AcuantCapture(
// This hook does that.
const isBackOfId = name === 'back';
useLogCameraInfo({ isBackOfId, hasStartedCropping });
const [isCapturingEnvironment, setIsCapturingEnvironment] = useState(
selfieCapture && immediatelyBeginCapture,
);
const [isCapturingEnvironment, setIsCapturingEnvironment] = useState(selfieCapture);

const {
failedCaptureAttempts,
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 @@ -178,7 +178,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 @@ -24,7 +24,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -49,7 +48,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -76,7 +74,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -99,7 +96,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: false,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand All @@ -126,7 +122,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: false,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand Down Expand Up @@ -155,7 +150,6 @@ describe('DocumentSideAcuantCapture', () => {
isSelfieCaptureEnabled: true,
isSelfieDesktopTestMode: true,
showHelpInitially: false,
immediatelyBeginCapture: false,
}}
>
<DocumentSideAcuantCapture {...DEFAULT_PROPS} side="front" />
Expand Down Expand Up @@ -192,7 +186,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

0 comments on commit 28a9b1b

Please sign in to comment.