diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js index 8ae86a8de5..3f2e39641b 100644 --- a/src/components/media_upload/media_upload.js +++ b/src/components/media_upload/media_upload.js @@ -11,11 +11,24 @@ const mediaUpload = { const file = target.files[0] const formData = new FormData() formData.append('media', file) + + self.$emit('uploading') + self.uploading = true + statusPosterService.uploadMedia({ store, formData }) .then((fileData) => { self.$emit('uploaded', fileData) + self.uploading = false + }, (error) => { + self.$emit('upload-failed') + self.uploading = false }) }) + }, + data () { + return { + uploading: false + } } } diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue index a62d831698..f2f0b83f9a 100644 --- a/src/components/media_upload/media_upload.vue +++ b/src/components/media_upload/media_upload.vue @@ -1,7 +1,8 @@