From 1a15105bdc83fe469ee3c3d2cc534fce55e481da Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 22 Mar 2023 14:46:11 -0400 Subject: [PATCH] Extract max file size so it can be computed later. --- .../textbox-question/textbox-question.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 9690a6815..895777f0d 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -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) {