diff --git a/app/javascript/vue/protocol/mixins/attachments.js b/app/javascript/vue/protocol/mixins/attachments.js index 32a2596f5..dcc8cac92 100644 --- a/app/javascript/vue/protocol/mixins/attachments.js +++ b/app/javascript/vue/protocol/mixins/attachments.js @@ -22,6 +22,8 @@ export default { let filesUploadedCntr = 0; this.showFileModal = false; + if (!this.step.attributes.urls.upload_attachment_url) return false; + return new Promise((resolve, reject) => { $(files).each((_, file) => { const fileObject = { diff --git a/app/javascript/vue/protocol/step.vue b/app/javascript/vue/protocol/step.vue index 68c4b0d1d..630d1fc0a 100644 --- a/app/javascript/vue/protocol/step.vue +++ b/app/javascript/vue/protocol/step.vue @@ -254,7 +254,7 @@ }, methods: { dragEnter(e) { - if (this.showFileModal) return; + if (this.showFileModal || !urls.upload_attachment_url) return; // Detect if dragged element is a file // https://stackoverflow.com/a/8494918