turn off settings sync for now
This commit is contained in:
parent
e9a30dbbe1
commit
084fe71903
4 changed files with 43 additions and 43 deletions
|
@ -137,7 +137,7 @@ const GeneralTab = {
|
||||||
createSettingsProfile () {
|
createSettingsProfile () {
|
||||||
this.$store.dispatch('setOption', { name: 'profile', value: this.newProfileName })
|
this.$store.dispatch('setOption', { name: 'profile', value: this.newProfileName })
|
||||||
this.$store.dispatch('setOption', { name: 'profileVersion', value: 1 })
|
this.$store.dispatch('setOption', { name: 'profileVersion', value: 1 })
|
||||||
this.$store.dispatch('syncSettings')
|
// this.$store.dispatch('syncSettings')
|
||||||
this.newProfileName = ''
|
this.newProfileName = ''
|
||||||
},
|
},
|
||||||
forceSync () {
|
forceSync () {
|
||||||
|
|
|
@ -316,10 +316,10 @@ const api = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
listSettingsProfiles (store) {
|
listSettingsProfiles (store) {
|
||||||
store.state.backendInteractor.listSettingsProfiles({ store })
|
// store.state.backendInteractor.listSettingsProfiles({ store })
|
||||||
.then((data) => {
|
// .then((data) => {
|
||||||
store.commit('setInstanceOption', { name: 'settingsProfiles', value: data })
|
// store.commit('setInstanceOption', { name: 'settingsProfiles', value: data })
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
// Pleroma websocket
|
// Pleroma websocket
|
||||||
setWsToken (store, token) {
|
setWsToken (store, token) {
|
||||||
|
|
|
@ -216,7 +216,7 @@ const config = {
|
||||||
setOption ({ commit, dispatch }, { name, value, manual }) {
|
setOption ({ commit, dispatch }, { name, value, manual }) {
|
||||||
commit('setOption', { name, value })
|
commit('setOption', { name, value })
|
||||||
if (manual === true) {
|
if (manual === true) {
|
||||||
dispatch('syncSettings')
|
// dispatch('syncSettings')
|
||||||
}
|
}
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'theme':
|
case 'theme':
|
||||||
|
@ -237,34 +237,34 @@ const config = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSettingsProfile (store, forceUpdate = false) {
|
getSettingsProfile (store, forceUpdate = false) {
|
||||||
const profile = store.state.profile
|
// const profile = store.state.profile
|
||||||
store.rootState.api.backendInteractor.getSettingsProfile({ store, profileName: profile })
|
// store.rootState.api.backendInteractor.getSettingsProfile({ store, profileName: profile })
|
||||||
.then(({ settings, version }) => {
|
// .then(({ settings, version }) => {
|
||||||
console.log('found settings version', version)
|
// console.log('found settings version', version)
|
||||||
if (forceUpdate || (version > store.state.profileVersion)) {
|
// if (forceUpdate || (version > store.state.profileVersion)) {
|
||||||
store.commit('setOption', { name: 'profileVersion', value: version })
|
// store.commit('setOption', { name: 'profileVersion', value: version })
|
||||||
Object.entries(settings).forEach(([name, value]) => {
|
// Object.entries(settings).forEach(([name, value]) => {
|
||||||
if (store.state[name] !== value) {
|
// if (store.state[name] !== value) {
|
||||||
store.dispatch('setOption', { name, value })
|
// store.dispatch('setOption', { name, value })
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
console.log('settings are up to date')
|
// console.log('settings are up to date')
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.catch((err) => {
|
// .catch((err) => {
|
||||||
console.error(`could not fetch profile ${profile}`, err)
|
// console.error(`could not fetch profile ${profile}`, err)
|
||||||
if (err.statusCode === 404) {
|
// if (err.statusCode === 404) {
|
||||||
// create profile
|
// // create profile
|
||||||
store.dispatch('pushGlobalNotice', {
|
// store.dispatch('pushGlobalNotice', {
|
||||||
level: 'warning',
|
// level: 'warning',
|
||||||
messageKey: 'settings_profile.creating',
|
// messageKey: 'settings_profile.creating',
|
||||||
messageArgs: { profile },
|
// messageArgs: { profile },
|
||||||
timeout: 5000
|
// timeout: 5000
|
||||||
})
|
// })
|
||||||
store.dispatch('syncSettings')
|
// // store.dispatch('syncSettings')
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1548,15 +1548,15 @@ const getSettingsProfile = ({ profileName, credentials }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveSettingsProfile = ({ profileName, credentials, settings, version }) => {
|
const saveSettingsProfile = ({ profileName, credentials, settings, version }) => {
|
||||||
return promisedRequest({
|
// return promisedRequest({
|
||||||
url: AKKOMA_SETTING_PROFILE_URL(profileName),
|
// url: AKKOMA_SETTING_PROFILE_URL(profileName),
|
||||||
method: 'PUT',
|
// method: 'PUT',
|
||||||
credentials,
|
// credentials,
|
||||||
payload: {
|
// payload: {
|
||||||
settings,
|
// settings,
|
||||||
version
|
// version
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteSettingsProfile = ({ profileName, credentials }) => {
|
const deleteSettingsProfile = ({ profileName, credentials }) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue