diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/attachment/attachment.js | 13 | ||||
| -rw-r--r-- | src/components/attachment/attachment.vue | 2 | ||||
| -rw-r--r-- | src/components/settings/settings.js | 6 | ||||
| -rw-r--r-- | src/components/settings/settings.vue | 2 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 57d21b28..f4f6aebf 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -7,16 +7,19 @@ const Attachment = { 'nsfw', 'statusId' ], - data: () => ({ - nsfwImage, - showHidden: false - }), + data () { + return { + nsfwImage, + hideNsfwLocal: this.$store.state.config.hideNsfw, + showHidden: false + } + }, computed: { type () { return fileTypeService.fileType(this.attachment.mimetype) }, hidden () { - return this.nsfw && !this.showHidden + return this.nsfw && this.hideNsfwLocal && !this.showHidden } }, methods: { diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index e0eba6a9..45cc1929 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -3,7 +3,7 @@ <a class="image-attachment" v-if="hidden" v-on:click.prevent="toggleHidden()"> <img :key="nsfwImage" :src="nsfwImage"></img> </a> - <div class="hider" v-if="nsfw && !hidden"> + <div class="hider" v-if="nsfw && hideNsfwLocal && !hidden"> <a href="#" @click.prevent="toggleHidden()">Hide</a> </div> diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 61236af2..c1b88f82 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -3,7 +3,8 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue' const settings = { data () { return { - hideAttachmentsLocal: this.$store.state.config.hideAttachments + hideAttachmentsLocal: this.$store.state.config.hideAttachments, + hideNsfwLocal: this.$store.state.config.hideNsfw } }, components: { @@ -12,6 +13,9 @@ const settings = { watch: { hideAttachmentsLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachments', value }) + }, + hideNsfwLocal (value) { + this.$store.dispatch('setOption', { name: 'hideNsfw', value }) } } } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index f2f83953..89b89a39 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -12,6 +12,8 @@ <h2>Attachments</h2> <input type="checkbox" id="hideAttachments" v-model="hideAttachmentsLocal"> <label for="hideAttachments">Hide Attachments</label> + <input type="checkbox" id="hideNsfw" v-model="hideNsfwLocal"> + <label for="hideNsfw">Enable clickthrough NSFW attachment hiding</label> </div> </div> </div> |
