mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Improve handleCameraError()
This commit is contained in:
parent
391a533ce1
commit
8302fcf805
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user