Improve handleCameraError()

This commit is contained in:
Yang Luo 2024-03-16 09:55:55 +08:00
parent 391a533ce1
commit 8302fcf805

View File

@ -98,8 +98,13 @@ const FaceRecognitionModal = (props) => {
} }
}; };
const handleCameraError = () => { const handleCameraError = (error) => {
message.error(i18next.t("login:There was a problem accessing the WEBCAM. Grant permission and reload the page.")); // https://github.com/mozmorris/react-webcam/issues/272
if (error.message.includes("device not found")) {
message.error(i18next.t("login:You need to have a camera device to login with Face ID"));
} else {
message.error(error.message);
}
}; };
return ( return (