logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: f956b0ca37d33120bb4e28f3cc70b9cb6cec066f
parent df632652fa250784fcaae1024164f7edd0edfc76
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Sun, 15 Jan 2023 12:37:12 +0000

Merge branch 'tusooa/1159-debounce-wordfilter' into 'develop'

Debounce mute word setting

Closes #1159

See merge request pleroma/pleroma-fe!1758

Diffstat:

Msrc/components/settings_modal/tabs/filtering_tab.js9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js @@ -1,4 +1,4 @@ -import { filter, trim } from 'lodash' +import { filter, trim, debounce } from 'lodash' import BooleanSetting from '../helpers/boolean_setting.vue' import ChoiceSetting from '../helpers/choice_setting.vue' import IntegerSetting from '../helpers/integer_setting.vue' @@ -29,11 +29,16 @@ const FilteringTab = { }, set (value) { this.muteWordsStringLocal = value + this.debouncedSetMuteWords(value) + } + }, + debouncedSetMuteWords () { + return debounce((value) => { this.$store.dispatch('setOption', { name: 'muteWords', value: filter(value.split('\n'), (word) => trim(word).length > 0) }) - } + }, 1000) } }, // Updating nested properties