Add re-hiding of nsfw images.

This commit is contained in:
Roger Braun 2016-12-02 14:22:42 +01:00
parent df51d08814
commit 6e608dd2dd
2 changed files with 25 additions and 8 deletions

View file

@ -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
export default Attachment