Compare commits

..

No commits in common. "c50181f7d0df87be94cde2283f75b1b9be7068c7" and "b1f3e097f4590f4cb6e6c8ae48d769cd254a1bb3" have entirely different histories.

View file

@ -3,6 +3,7 @@ import {
merge as _merge,
clamp,
cloneDeep,
debounce,
findLastIndex,
flatten,
get,
@ -446,6 +447,18 @@ const _doMigrations = async (data, setPreference) => {
return data
}
const _pushSyncConfig = debounce((force, root) => {
const needPush = root.dirty || force
if (!needPush) return
root.updateCache({ username: window.vuex.state.users.currentUser.fqn })
const params = { pleroma_settings_store: { 'pleroma-fe': root.cache } }
window.vuex.state.api.backendInteractor
.updateProfileJSON({ params })
.then((user) => {
root.initSyncConfig(user)
root.dirty = false
})
}, 5000)
export const useSyncConfigStore = defineStore('sync_config', {
state() {
@ -701,12 +714,7 @@ export const useSyncConfigStore = defineStore('sync_config', {
this.pushSyncConfig()
},
pushSyncConfig({ force = false } = {}) {
const needPush = this.dirty || force
if (!needPush) return
this.updateCache({ username: window.vuex.state.users.currentUser.fqn })
const params = { pleroma_settings_store: { 'pleroma-fe': this.cache } }
window.vuex.state.api.backendInteractor
.updateProfileJSON({ params })
_pushSyncConfig(force, this)
},
},
getters: {