logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: eae62e2eb839fedf51fc5c8979698103a48d7eb8
parent e009510c52d62a19136e01d9f0753448ad703016
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Thu, 22 Dec 2022 13:15:46 +0000

Merge branch 'fix-excessive-reregistrations' into 'develop'

Fix rogue nested watcher triggering notifications registering too often

Closes #1159

See merge request pleroma/pleroma-fe!1708

Diffstat:

Msrc/components/settings_modal/helpers/boolean_setting.js6++++++
Msrc/components/settings_modal/tabs/filtering_tab.js9---------
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/components/settings_modal/helpers/boolean_setting.js b/src/components/settings_modal/helpers/boolean_setting.js @@ -41,7 +41,13 @@ export default { }, methods: { update (e) { + const [firstSegment, ...rest] = this.path.split('.') set(this.$parent, this.path, e) + // Updating nested properties does not trigger update on its parent. + // probably still not as reliable, but works for depth=1 at least + if (rest.length > 0) { + set(this.$parent, firstSegment, { ...get(this.$parent, firstSegment) }) + } }, reset () { set(this.$parent, this.path, this.defaultState) diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js @@ -38,15 +38,6 @@ const FilteringTab = { }, // Updating nested properties watch: { - notificationVisibility: { - handler (value) { - this.$store.dispatch('setOption', { - name: 'notificationVisibility', - value: this.$store.getters.mergedConfig.notificationVisibility - }) - }, - deep: true - }, replyVisibility () { this.$store.dispatch('queueFlushAll') }