From b213dcda0be8ab808768b8c3f5c1abc0add5f11c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 25 Jul 2020 20:55:40 -0600 Subject: [PATCH] Update ComposeModal.vue, add 451 http code warning --- .../assets/js/components/ComposeModal.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue index 65eddaf50..8f36f5ec4 100644 --- a/resources/assets/js/components/ComposeModal.vue +++ b/resources/assets/js/components/ComposeModal.vue @@ -700,10 +700,21 @@ export default { self.page = 2; }, 300); }).catch(function(e) { - self.uploading = false; - io.value = null; - swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error'); - self.page = 2; + switch(e.response.status) { + case 451: + self.uploading = false; + io.value = null; + swal('Banned Content', 'This content has been banned and cannot be uploaded.', 'error'); + self.page = 2; + break; + + default: + self.uploading = false; + io.value = null; + swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error'); + self.page = 2; + break; + } }); io.value = null; self.uploadProgress = 0;