From f4ee222e3c13caf51ad15d820a75665a3f1a51e3 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 22 Apr 2018 09:10:10 -0500 Subject: [PATCH] make nsfw censor image configurable --- src/components/attachment/attachment.js | 2 +- src/main.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index d9bc44774c..ad46d0a1b8 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -11,7 +11,7 @@ const Attachment = { ], data () { return { - nsfwImage, + nsfwImage: this.$store.state.config.nsfwCensorImage || nsfwImage, hideNsfwLocal: this.$store.state.config.hideNsfw, showHidden: false, loading: false, diff --git a/src/main.js b/src/main.js index 6f8c00f04f..3d2bcbb038 100644 --- a/src/main.js +++ b/src/main.js @@ -96,6 +96,9 @@ window.fetch('/static/config.json') if (data['chatDisabled']) { store.dispatch('disableChat') } + if (data['nsfwCensorImage']) { + store.dispatch('setOption', { name: 'nsfwCensorImage', value: data['nsfwCensorImage'] }) + } const routes = [ { name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' },