aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-18 09:24:07 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-31 16:41:43 +0100
commitffae8000d11db5a364659ddb9e3e594b76ace2ea (patch)
tree4cb7798fa29924657d4dca865216f3585a86bcf9 /apps/settings
parentf629e540febc92aecef3ef1dc7a96624c547abe2 (diff)
downloadnextcloud-server-ffae8000d11db5a364659ddb9e3e594b76ace2ea.tar.gz
nextcloud-server-ffae8000d11db5a364659ddb9e3e594b76ace2ea.zip
fix(settings): stop reloading after force-enabling an app
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/src/store/apps.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/settings/src/store/apps.js b/apps/settings/src/store/apps.js
index 86ac15f69a2..d1c5be8034f 100644
--- a/apps/settings/src/store/apps.js
+++ b/apps/settings/src/store/apps.js
@@ -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 }) {