From e654fead23ebb457f81e8642c65e1f3e98ee0027 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 17 Jun 2021 16:29:46 +0300 Subject: refactored attachments and gallery. All attachments now are in gallery. --- src/components/status_content/status_content.js | 20 +-------------- src/components/status_content/status_content.vue | 31 +++++++----------------- 2 files changed, 10 insertions(+), 41 deletions(-) (limited to 'src/components/status_content') diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js index 51895ef6..49f9d7f8 100644 --- a/src/components/status_content/status_content.js +++ b/src/components/status_content/status_content.js @@ -58,24 +58,6 @@ const StatusContent = { } return 'normal' }, - galleryTypes () { - if (this.attachmentSize === 'hide') { - return [] - } - return this.mergedConfig.playVideosInModal - ? ['image', 'video'] - : ['image'] - }, - galleryAttachments () { - return this.status.attachments.filter( - file => fileType.fileMatchesSomeType(this.galleryTypes, file) - ) - }, - nonGalleryAttachments () { - return this.status.attachments.filter( - file => !fileType.fileMatchesSomeType(this.galleryTypes, file) - ) - }, maxThumbnails () { return this.mergedConfig.maxThumbnails }, @@ -93,7 +75,7 @@ const StatusContent = { }, methods: { setMedia () { - const attachments = this.attachmentSize === 'hide' ? this.status.attachments : this.galleryAttachments + const attachments = this.status.attachments return () => this.$store.dispatch('setMedia', attachments) } } diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue index 2e71757d..0f999da6 100644 --- a/src/components/status_content/status_content.vue +++ b/src/components/status_content/status_content.vue @@ -11,29 +11,16 @@ -
- - -
+ v-if="status.attachments.length !== 0" + :nsfw="nsfwClickthrough" + :attachments="status.attachments" + :set-media="setMedia()" + :size="attachmentSize" + @play="$emit('mediaplay', attachment.id)" + @pause="$emit('mediapause', attachment.id)" + />