Block other actions during update

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-05-30 16:10:37 +02:00
parent 1a034ce699
commit 67753321b3
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 3 additions and 0 deletions

View File

@ -258,14 +258,17 @@ const actions = {
updateApp(context, { appId }) { updateApp(context, { appId }) {
return api.requireAdmin().then((response) => { return api.requireAdmin().then((response) => {
context.commit('startLoading', appId); context.commit('startLoading', appId);
context.commit('startLoading', 'install');
return api.get(OC.generateUrl(`settings/apps/update/${appId}`)) return api.get(OC.generateUrl(`settings/apps/update/${appId}`))
.then((response) => { .then((response) => {
context.commit('stopLoading', 'install');
context.commit('stopLoading', appId); context.commit('stopLoading', appId);
context.commit('updateApp', appId); context.commit('updateApp', appId);
return true; return true;
}) })
.catch((error) => { .catch((error) => {
context.commit('stopLoading', appId); context.commit('stopLoading', appId);
context.commit('stopLoading', 'install');
context.commit('APPS_API_FAILURE', { appId, error }) context.commit('APPS_API_FAILURE', { appId, error })
}) })
}).catch((error) => context.commit('API_FAILURE', { appId, error })); }).catch((error) => context.commit('API_FAILURE', { appId, error }));