From 2f5ad6b38b9acc7e6acf021992d0e8167b10eb34 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 27 Nov 2019 15:43:41 -0500 Subject: [PATCH] Move event emitter before async function call so it will hopefully trigger the change event on the parent component earlier. Update this.changed inside if statement because it should only be updated if the file is successfully uploaded. --- js/components/upload_input.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/components/upload_input.js b/js/components/upload_input.js index 52cd8bf8..cdd9b15e 100644 --- a/js/components/upload_input.js +++ b/js/components/upload_input.js @@ -58,18 +58,18 @@ export default { this.$refs.attachmentFilename.value = file.name this.$refs.attachmentObjectName.value = response.objectName this.$refs.attachmentInput.disabled = true + emitFieldChange(this) + this.changed = true this.downloadLink = await this.getDownloadLink( file.name, response.objectName ) } else { + emitFieldChange(this) + this.changed = true this.uploadError = true } - - this.changed = true - - emitFieldChange(this) }, removeAttachment: function(e) { e.preventDefault()