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.
This commit is contained in:
leigh-mil 2019-11-27 15:43:41 -05:00
parent 699176fc91
commit 2f5ad6b38b

View File

@ -58,18 +58,18 @@ export default {
this.$refs.attachmentFilename.value = file.name this.$refs.attachmentFilename.value = file.name
this.$refs.attachmentObjectName.value = response.objectName this.$refs.attachmentObjectName.value = response.objectName
this.$refs.attachmentInput.disabled = true this.$refs.attachmentInput.disabled = true
emitFieldChange(this)
this.changed = true
this.downloadLink = await this.getDownloadLink( this.downloadLink = await this.getDownloadLink(
file.name, file.name,
response.objectName response.objectName
) )
} else { } else {
emitFieldChange(this)
this.changed = true
this.uploadError = true this.uploadError = true
} }
this.changed = true
emitFieldChange(this)
}, },
removeAttachment: function(e) { removeAttachment: function(e) {
e.preventDefault() e.preventDefault()