Extract max file size so it can be computed later.

This commit is contained in:
Chloe Herd 2023-03-22 14:46:11 -04:00
parent 5b6433cb1c
commit 1a15105bdc

View file

@ -159,9 +159,8 @@ export default {
},
isImageValid(imageFile) {
let maxSize = 0.5 * 1028 * 1028;
return imageFile && imageFile.size < maxSize;
return imageFile && imageFile.size < this.maxFileSize;
},
},
computed: {
@ -200,6 +199,12 @@ export default {
return questionText;
},
},
maxFileSize() {
let kiloBytes = 512;
return kiloBytes * 1028;
}
},
watch: {
async value(newValue) {