chore: Delayed deploy of direct uploads (#3966)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Tejaswini Chile
2022-02-15 16:16:54 +05:30
committed by GitHub
parent 2591a04c0b
commit 94a473c9f8
12 changed files with 90 additions and 40 deletions

View File

@@ -7,7 +7,7 @@
>
<div class="thumb-wrap">
<img
v-if="isTypeImage(attachment.resource.content_type)"
v-if="isTypeImage(attachment.resource)"
class="image-thumb"
:src="attachment.thumb"
/>
@@ -15,12 +15,12 @@
</div>
<div class="file-name-wrap">
<span class="item">
{{ attachment.resource.filename }}
{{ fileName(attachment.resource) }}
</span>
</div>
<div class="file-size-wrap">
<span class="item">
{{ formatFileSize(attachment.resource.byte_size) }}
{{ formatFileSize(attachment.resource) }}
</span>
</div>
<div class="remove-file-wrap">
@@ -50,12 +50,17 @@ export default {
onRemoveAttachment(index) {
this.removeAttachment(index);
},
formatFileSize(size) {
formatFileSize(file) {
const size = file.byte_size || file.size;
return formatBytes(size, 0);
},
isTypeImage(type) {
isTypeImage(file) {
const type = file.content_type || file.type;
return type.includes('image');
},
fileName(file) {
return file.filename || file.name;
},
},
};
</script>