mirror of
https://github.com/Lissy93/dashy.git
synced 2025-04-08 17:06:18 +02:00
⚡ Adds VueX store into main Vue entry point
This commit is contained in:
parent
2946412b4c
commit
c2e70dc07e
11
src/main.js
11
src/main.js
@ -49,9 +49,14 @@ ErrorReporting(Vue, router);
|
|||||||
// Render function
|
// Render function
|
||||||
const render = (awesome) => awesome(Dashy);
|
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 Keycloak not enabled, then proceed straight to the app
|
||||||
if (!isKeycloakEnabled()) {
|
if (!isKeycloakEnabled()) {
|
||||||
new Vue({ router, render, i18n }).$mount('#app');
|
mount();
|
||||||
} else { // Keycloak is enabled, redirect to KC login page
|
} else { // Keycloak is enabled, redirect to KC login page
|
||||||
const { serverUrl, realm, clientId } = getKeycloakConfig();
|
const { serverUrl, realm, clientId } = getKeycloakConfig();
|
||||||
const initOptions = {
|
const initOptions = {
|
||||||
@ -64,9 +69,7 @@ if (!isKeycloakEnabled()) {
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
// Yay - user successfully authenticated with Keycloak, render the app!
|
// Yay - user successfully authenticated with Keycloak, render the app!
|
||||||
new Vue({
|
mount();
|
||||||
router, store, render, i18n,
|
|
||||||
}).$mount('#app');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user