From 87139077da4878272e858321c75594836123cc64 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 24 Mar 2021 17:18:10 +0100 Subject: [PATCH] [plugin] Error message if loading failed --- src/boot/plugins.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/boot/plugins.ts b/src/boot/plugins.ts index c9960ae..06e1444 100644 --- a/src/boot/plugins.ts +++ b/src/boot/plugins.ts @@ -4,6 +4,7 @@ import routes from 'src/router/routes'; import { api } from 'boot/axios'; import { AxiosResponse } from 'axios'; import { RouteRecordRaw } from 'vue-router'; +import { Notify } from 'quasar'; const config: { [key: string]: Array } = { // Do not change required Modules !! @@ -340,13 +341,23 @@ export default boot(async ({ router, app }) => { }); // Load user defined plugins + const failed: string[] = []; config.loadModules.forEach((required) => { const plugin = loadPlugin(loadedPlugins, required, pluginsContext, backend); if (!plugin) { - void router.push({ name: 'error' }); - return; + failed.push(required); } }); + if (failed.length > 0) { + console.error('Could not load all plugins', failed); + Notify.create({ + type: 'negative', + message: + 'Fehler beim laden, nicht alle Funktionen stehen zur Verfügung. Bitte wende dich an den Admin!', + timeout: 10000, + progress: true, + }); + } // Sort widgets by priority loadedPlugins.widgets.sort((a, b) => b.priority - a.priority);