diff options
Diffstat (limited to 'src/components/attachment/attachment.js')
| -rw-r--r-- | src/components/attachment/attachment.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 9f751863..c88497a2 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -1,4 +1,4 @@ -import nsfwImage from '../../assets/nsfw.jpg' +import nsfwImage from '../../assets/nsfw.png' import fileTypeService from '../../services/file_type/file_type.service.js' const Attachment = { @@ -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 |
