From 4e567e34115e018fb96eb9ab199ff157de5a4981 Mon Sep 17 00:00:00 2001 From: mbliznikova Date: Tue, 9 Jan 2024 04:49:01 +0000 Subject: [PATCH] Provide an informative error message when account size limit is reached --- resources/assets/js/components/ComposeModal.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue index 4ffd84666..2c4e3ba42 100644 --- a/resources/assets/js/components/ComposeModal.vue +++ b/resources/assets/js/components/ComposeModal.vue @@ -1204,12 +1204,19 @@ export default { }, 300); }).catch(function(e) { switch(e.response.status) { + case 403: + self.uploading = false; + io.value = null; + swal('Account size limit reached', 'Contact your admin for assistance.', 'error'); + self.page = 2; + break; + case 413: self.uploading = false; io.value = null; swal('File is too large', 'The file you uploaded has the size of ' + self.formatBytes(io.size) + '. Unfortunately, only images up to ' + self.formatBytes(self.config.uploader.max_photo_size * 1024) + ' are supported.\nPlease resize the file and try again.', 'error'); self.page = 2; - break; + break; case 451: self.uploading = false;