Skip to content

Commit

Permalink
fix: Show Match indicator during CANT_IDENTIFY state during recording (
Browse files Browse the repository at this point in the history
…#825)

* fix: Show Match indicator during CANT_IDENTIFY state during recording

* consolidate state check into showMatchIndicatorStates

---------

Co-authored-by: Heather Buchel <[email protected]>
  • Loading branch information
hbuchel and Heather Buchel authored Mar 31, 2023
1 parent 1f93c1f commit 441715c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export const LivenessCameraModule = (
const videoConstraints = useLivenessSelector(selectVideoConstraints);
const faceMatchPercentage = useLivenessSelector(selectFaceMatchPercentage);
const faceMatchState = useLivenessSelector(selectFaceMatchState);
const showMatchIndicatorStates = [
FaceMatchState.TOO_FAR,
FaceMatchState.CANT_IDENTIFY,
FaceMatchState.FACE_IDENTIFIED,
];

const { videoRef, videoWidth, videoHeight } = useMediaStreamInVideo(
videoStream,
Expand Down Expand Up @@ -210,8 +215,7 @@ export const LivenessCameraModule = (
initial face identified state
*/}
{isRecording &&
(faceMatchState === FaceMatchState.TOO_FAR ||
faceMatchState === FaceMatchState.FACE_IDENTIFIED) ? (
showMatchIndicatorStates.includes(faceMatchState) ? (
<MatchIndicator percentage={faceMatchPercentage} />
) : null}

Expand Down

0 comments on commit 441715c

Please sign in to comment.