fix(settings): stop reloading after force-enabling an app

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/42913/head
John Molakvoæ 4 months ago
parent f629e540fe
commit ffae8000d1
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF

@ -90,6 +90,13 @@ const mutations = {
app.groups = groups
},
setInstallState(state, { appId, canInstall }) {
const app = state.apps.find(app => app.id === appId)
if (app) {
app.canInstall = canInstall === true
}
},
disableApp(state, appId) {
const app = state.apps.find(app => app.id === appId)
app.active = false
@ -237,8 +244,7 @@ const actions = {
context.commit('startLoading', 'install')
return api.post(generateUrl('settings/apps/force'), { appId })
.then((response) => {
// TODO: find a cleaner solution
location.reload()
context.commit('setInstallState', { appId, canInstall: true })
})
.catch((error) => {
context.commit('stopLoading', apps)
@ -249,6 +255,10 @@ const actions = {
})
context.commit('APPS_API_FAILURE', { appId, error })
})
.finally(() => {
context.commit('stopLoading', apps)
context.commit('stopLoading', 'install')
})
}).catch((error) => context.commit('API_FAILURE', { appId, error }))
},
disableApp(context, { appId }) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save