aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-07-04 13:36:16 +0200
committerJulius Härtl <jus@bitgrid.net>2018-07-04 15:40:51 +0200
commitebeb2da3d3e474c60f765020ede3cf23cfb03be0 (patch)
tree168a8027b540390e9548381f9141ec61bcf8d1e8 /settings
parent96e65c677be77315cd6b6f5a3a0819b04803ebf6 (diff)
downloadnextcloud-server-ebeb2da3d3e474c60f765020ede3cf23cfb03be0.tar.gz
nextcloud-server-ebeb2da3d3e474c60f765020ede3cf23cfb03be0.zip
Fix displaying errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings')
-rw-r--r--settings/src/components/appList/appItem.vue8
-rw-r--r--settings/src/store/apps.js16
2 files changed, 16 insertions, 8 deletions
diff --git a/settings/src/components/appList/appItem.vue b/settings/src/components/appList/appItem.vue
index 5a4a503f3c9..f9d5754b500 100644
--- a/settings/src/components/appList/appItem.vue
+++ b/settings/src/components/appList/appItem.vue
@@ -51,10 +51,10 @@
<div class="actions">
<div class="warning" v-if="app.error">{{ app.error }}</div>
<div class="icon icon-loading-small" v-if="loading(app.id)"></div>
- <input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to {update}', {update:app.update})" v-on:click="update(app.id)" :disabled="installing || loading(app.id)" />
- <input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" v-on:click="remove(app.id)" :disabled="installing || loading(app.id)" />
- <input v-if="app.active" class="enable" type="button" :value="t('settings','Disable')" v-on:click="disable(app.id)" :disabled="installing || loading(app.id)" />
- <input v-if="!app.active" class="enable" type="button" :value="enableButtonText" v-on:click="enable(app.id)" v-tooltip.auto="enableButtonTooltip" :disabled="!app.canInstall || installing || loading(app.id)" />
+ <input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to {update}', {update:app.update})" v-on:click.stop="update(app.id)" :disabled="installing || loading(app.id)" />
+ <input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" v-on:click.stop="remove(app.id)" :disabled="installing || loading(app.id)" />
+ <input v-if="app.active" class="enable" type="button" :value="t('settings','Disable')" v-on:click.stop="disable(app.id)" :disabled="installing || loading(app.id)" />
+ <input v-if="!app.active" class="enable" type="button" :value="enableButtonText" v-on:click.stop="enable(app.id)" v-tooltip.auto="enableButtonTooltip" :disabled="!app.canInstall || installing || loading(app.id)" />
</div>
</div>
</template>
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js
index c4539b14d93..99bd4af4595 100644
--- a/settings/src/store/apps.js
+++ b/settings/src/store/apps.js
@@ -62,8 +62,13 @@ const mutations = {
},
setError(state, {appId, error}) {
- let app = state.apps.find(app => app.id === appId);
- app.error = error;
+ if (!Array.isArray(appId)) {
+ appId = [appId];
+ }
+ appId.forEach((_id) => {
+ let app = state.apps.find(app => app.id === _id);
+ app.error = error;
+ });
},
clearError(state, {appId, error}) {
@@ -199,10 +204,13 @@ const actions = {
});
})
.catch((error) => {
- context.commit('setError', {appId: apps, error: t('settings', 'Error while enabling app')});
context.commit('stopLoading', apps);
context.commit('stopLoading', 'install');
- context.commit('APPS_API_FAILURE', { appId, error })
+ context.commit('setError', {
+ appId: apps,
+ error: error.response.data.data.message
+ });
+ context.commit('APPS_API_FAILURE', { appId, error});
})
}).catch((error) => context.commit('API_FAILURE', { appId, error }));
},