Components: ImageEditor: add error handler
This commit is contained in:
parent
93fd498284
commit
df4c90d838
@ -76,6 +76,7 @@ const Dropzone = ({ t, setUploadedFile, isDisabled }) => {
|
||||
timer.current = setTimeout(() => {
|
||||
setLoadingFile(true);
|
||||
}, 50);
|
||||
try {
|
||||
const imageBitMap = await createImageBitmap(file);
|
||||
|
||||
const width = imageBitMap.width;
|
||||
@ -107,6 +108,13 @@ const Dropzone = ({ t, setUploadedFile, isDisabled }) => {
|
||||
setLoadingFile(false);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
toastr.error(error);
|
||||
timer.current && clearTimeout(timer.current);
|
||||
if (mount.current) {
|
||||
setLoadingFile(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const { getRootProps, getInputProps } = useDropzone({
|
||||
|
Loading…
Reference in New Issue
Block a user