From cd959d9df8c5cec8361892d92daf524ecfa4c76f Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 9 Apr 2017 22:15:49 +0200 Subject: [PATCH] Remove completely empty words. --- src/components/settings/settings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 7aa4bbc456..4d0528b6ef 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,4 +1,5 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue' +import { filter, trim } from 'lodash' const settings = { data () { @@ -23,7 +24,8 @@ const settings = { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, muteWordsString (value) { - this.$store.dispatch('setOption', { name: 'muteWords', value: value.split('\n') }) + value = filter(value.split('\n'), (word) => trim(word).length > 0) + this.$store.dispatch('setOption', { name: 'muteWords', value }) } } }