debounce instead of throttle
This commit is contained in:
parent
f29710d0af
commit
12b4b00e49
2 changed files with 2 additions and 7 deletions
|
|
@ -259,7 +259,6 @@ const FilteringTab = {
|
||||||
this.$store.dispatch('queueFlushAll')
|
this.$store.dispatch('queueFlushAll')
|
||||||
},
|
},
|
||||||
muteFiltersObject() {
|
muteFiltersObject() {
|
||||||
console.log('UPDATE')
|
|
||||||
this.muteFiltersDraftObject = cloneDeep(
|
this.muteFiltersDraftObject = cloneDeep(
|
||||||
useSyncConfigStore().prefsStorage.simple.muteFilters,
|
useSyncConfigStore().prefsStorage.simple.muteFilters,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
takeRight,
|
takeRight,
|
||||||
uniqWith,
|
uniqWith,
|
||||||
unset,
|
unset,
|
||||||
throttle,
|
debounce,
|
||||||
} from 'lodash'
|
} from 'lodash'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { toRaw } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
|
|
@ -449,7 +449,7 @@ const _doMigrations = async (data, setPreference) => {
|
||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
const _pushSyncConfig = throttle((force, root) => {
|
const _pushSyncConfig = debounce((force, root) => {
|
||||||
const needPush = root.dirty || force
|
const needPush = root.dirty || force
|
||||||
if (!needPush) return
|
if (!needPush) return
|
||||||
root.updateCache({ username: window.vuex.state.users.currentUser.fqn })
|
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: _0, _version: _1, ...recentData } = recent
|
||||||
const { _timestamp: _2, _version: _3, ...staleData } = stale
|
const { _timestamp: _2, _version: _3, ...staleData } = stale
|
||||||
dirty = sum(recentData) !== sum(staleData)
|
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`)
|
console.debug(`Data ${dirty ? 'needs' : "doesn't need"} merging`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue