mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 06:08:46 -04:00
fix(settings): stop reloading after force-enabling an app
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
f629e540fe
commit
ffae8000d1
3 changed files with 15 additions and 5 deletions
|
|
@ -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…
Reference in a new issue