turn off settings sync for now

This commit is contained in:
CoolElectronics 2024-06-10 22:40:23 -04:00
parent e9a30dbbe1
commit 084fe71903
No known key found for this signature in database
GPG key ID: F63593D168636C50
4 changed files with 43 additions and 43 deletions

View file

@ -137,7 +137,7 @@ const GeneralTab = {
createSettingsProfile () {
this.$store.dispatch('setOption', { name: 'profile', value: this.newProfileName })
this.$store.dispatch('setOption', { name: 'profileVersion', value: 1 })
this.$store.dispatch('syncSettings')
// this.$store.dispatch('syncSettings')
this.newProfileName = ''
},
forceSync () {

View file

@ -316,10 +316,10 @@ const api = {
})
},
listSettingsProfiles (store) {
store.state.backendInteractor.listSettingsProfiles({ store })
.then((data) => {
store.commit('setInstanceOption', { name: 'settingsProfiles', value: data })
})
// store.state.backendInteractor.listSettingsProfiles({ store })
// .then((data) => {
// store.commit('setInstanceOption', { name: 'settingsProfiles', value: data })
// })
},
// Pleroma websocket
setWsToken (store, token) {

View file

@ -216,7 +216,7 @@ const config = {
setOption ({ commit, dispatch }, { name, value, manual }) {
commit('setOption', { name, value })
if (manual === true) {
dispatch('syncSettings')
// dispatch('syncSettings')
}
switch (name) {
case 'theme':
@ -237,34 +237,34 @@ const config = {
}
},
getSettingsProfile (store, forceUpdate = false) {
const profile = store.state.profile
store.rootState.api.backendInteractor.getSettingsProfile({ store, profileName: profile })
.then(({ settings, version }) => {
console.log('found settings version', version)
if (forceUpdate || (version > store.state.profileVersion)) {
store.commit('setOption', { name: 'profileVersion', value: version })
Object.entries(settings).forEach(([name, value]) => {
if (store.state[name] !== value) {
store.dispatch('setOption', { name, value })
}
})
} else {
console.log('settings are up to date')
}
})
.catch((err) => {
console.error(`could not fetch profile ${profile}`, err)
if (err.statusCode === 404) {
// create profile
store.dispatch('pushGlobalNotice', {
level: 'warning',
messageKey: 'settings_profile.creating',
messageArgs: { profile },
timeout: 5000
})
store.dispatch('syncSettings')
}
})
// const profile = store.state.profile
// store.rootState.api.backendInteractor.getSettingsProfile({ store, profileName: profile })
// .then(({ settings, version }) => {
// console.log('found settings version', version)
// if (forceUpdate || (version > store.state.profileVersion)) {
// store.commit('setOption', { name: 'profileVersion', value: version })
// Object.entries(settings).forEach(([name, value]) => {
// if (store.state[name] !== value) {
// store.dispatch('setOption', { name, value })
// }
// })
// } else {
// console.log('settings are up to date')
// }
// })
// .catch((err) => {
// console.error(`could not fetch profile ${profile}`, err)
// if (err.statusCode === 404) {
// // create profile
// store.dispatch('pushGlobalNotice', {
// level: 'warning',
// messageKey: 'settings_profile.creating',
// messageArgs: { profile },
// timeout: 5000
// })
// // store.dispatch('syncSettings')
// }
// })
}
}
}

View file

@ -1548,15 +1548,15 @@ const getSettingsProfile = ({ profileName, credentials }) => {
}
const saveSettingsProfile = ({ profileName, credentials, settings, version }) => {
return promisedRequest({
url: AKKOMA_SETTING_PROFILE_URL(profileName),
method: 'PUT',
credentials,
payload: {
settings,
version
}
})
// return promisedRequest({
// url: AKKOMA_SETTING_PROFILE_URL(profileName),
// method: 'PUT',
// credentials,
// payload: {
// settings,
// version
// }
// })
}
const deleteSettingsProfile = ({ profileName, credentials }) => {