diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 9f751863e7..223249227a 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -7,17 +7,23 @@ const Attachment = { 'nsfw', 'statusId' ], - data: () => ({ nsfwImage }), + data: () => ({ + nsfwImage, + showHidden: false + }), computed: { type () { return fileTypeService.fileType(this.attachment.mimetype) + }, + hidden () { + return this.nsfw && !this.showHidden } }, methods: { - showNsfw () { - this.$store.commit('setNsfw', { id: this.statusId, nsfw: false }) + toggleHidden () { + this.showHidden = !this.showHidden } } } -export default Attachment \ No newline at end of file +export default Attachment diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 1e49cbebf1..6bc0356a1f 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -1,15 +1,18 @@