From 12b4b00e4959c6c8b531b320437612356fa8aa9f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 16 Mar 2026 18:48:42 +0200 Subject: [PATCH] debounce instead of throttle --- src/components/settings_modal/tabs/filtering_tab.js | 1 - src/stores/sync_config.js | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js index 3598de757..691563e88 100644 --- a/src/components/settings_modal/tabs/filtering_tab.js +++ b/src/components/settings_modal/tabs/filtering_tab.js @@ -259,7 +259,6 @@ const FilteringTab = { this.$store.dispatch('queueFlushAll') }, muteFiltersObject() { - console.log('UPDATE') this.muteFiltersDraftObject = cloneDeep( useSyncConfigStore().prefsStorage.simple.muteFilters, ) diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index 4617046c9..7d91dfe84 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -11,7 +11,7 @@ import { takeRight, uniqWith, unset, - throttle, + debounce, } from 'lodash' import { defineStore } from 'pinia' import { toRaw } from 'vue' @@ -449,7 +449,7 @@ const _doMigrations = async (data, setPreference) => { return data } -const _pushSyncConfig = throttle((force, root) => { +const _pushSyncConfig = debounce((force, root) => { const needPush = root.dirty || force if (!needPush) return root.updateCache({ username: window.vuex.state.users.currentUser.fqn }) @@ -681,10 +681,6 @@ export const useSyncConfigStore = defineStore('sync_config', { const { _timestamp: _0, _version: _1, ...recentData } = recent const { _timestamp: _2, _version: _3, ...staleData } = stale dirty = sum(recentData) !== sum(staleData) - console.log(sum(recentData), sum(staleData), recentData.prefsStorage) - console.log(sum(recentData.prefsStorage), sum(staleData.prefsStorage)) - console.log('J', sum(recentData.prefsStorage._journal), sum(staleData.prefsStorage._journal)) - console.log('S', sum(recentData.prefsStorage.simple), sum(staleData.prefsStorage.simple)) console.debug(`Data ${dirty ? 'needs' : "doesn't need"} merging`) }