Don't show dialog when setting front movie image (#678)

This commit is contained in:
WithoutPants
2020-07-21 08:30:26 +10:00
committed by GitHub
parent c104c6d075
commit c1be600b01
2 changed files with 16 additions and 6 deletions

View File

@@ -3,7 +3,12 @@ import Jimp from "jimp";
const readImage = (file: File, onLoadEnd: (imageData: string) => void) => {
const reader: FileReader = new FileReader();
reader.onloadend = () => onLoadEnd(reader.result as string);
reader.onloadend = () => {
// only proceed if no error encountered
if (!reader.error) {
onLoadEnd(reader.result as string);
}
};
reader.readAsDataURL(file);
};