Fix updated settings/config init routine on settings UI.

This commit is contained in:
Kailash Nadh 2022-03-02 21:31:00 +05:30
parent b4c716302f
commit 3b0c8b3b15

View file

@ -32,23 +32,7 @@ router.afterEach((to) => {
});
});
const v = new Vue({
router,
store,
i18n,
render: (h) => h(App),
data: {
isLoaded: false,
},
mounted() {
v.isLoaded = true;
},
});
function initConfig(app) {
// Load server side config and language before mounting the app.
api.getServerConfig().then((data) => {
api.getLang(data.lang).then((lang) => {
@ -63,8 +47,34 @@ api.getServerConfig().then((data) => {
const t = to.meta.title ? `${i18n.tc(to.meta.title, 0)} /` : '';
document.title = `${t} listmonk`;
v.$mount('#app');
if (app) {
app.$mount('#app');
}
});
});
api.getSettings();
}
const v = new Vue({
router,
store,
i18n,
render: (h) => h(App),
data: {
isLoaded: false,
},
methods: {
loadConfig() {
initConfig();
},
},
mounted() {
v.isLoaded = true;
},
});
initConfig(v);