mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Improve handleCameraError()
This commit is contained in:
@ -98,8 +98,13 @@ const FaceRecognitionModal = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleCameraError = () => {
|
||||
message.error(i18next.t("login:There was a problem accessing the WEBCAM. Grant permission and reload the page."));
|
||||
const handleCameraError = (error) => {
|
||||
// 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 (
|
||||
|
Reference in New Issue
Block a user