From c2e70dc07e83fd5df548adbed186a4b114a1647a Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 9 Oct 2021 18:30:47 +0100 Subject: [PATCH] :zap: Adds VueX store into main Vue entry point --- src/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index cae12b4f..280aad5c 100644 --- a/src/main.js +++ b/src/main.js @@ -49,9 +49,14 @@ ErrorReporting(Vue, router); // Render function const render = (awesome) => awesome(Dashy); +// Mount the app, with router, store i18n and render func +const mount = () => new Vue({ + router, render, i18n, store, +}).$mount('#app'); + // If Keycloak not enabled, then proceed straight to the app if (!isKeycloakEnabled()) { - new Vue({ router, render, i18n }).$mount('#app'); + mount(); } else { // Keycloak is enabled, redirect to KC login page const { serverUrl, realm, clientId } = getKeycloakConfig(); const initOptions = { @@ -64,9 +69,7 @@ if (!isKeycloakEnabled()) { window.location.reload(); } else { // Yay - user successfully authenticated with Keycloak, render the app! - new Vue({ - router, store, render, i18n, - }).$mount('#app'); + mount(); } }); }