2019-09-26 00:48:35 +02:00
|
|
|
import { I18n } from "./i18n";
|
|
|
|
|
2019-09-25 20:32:52 +02:00
|
|
|
export const appState = (app, state, emitter) => {
|
2019-09-26 00:48:35 +02:00
|
|
|
state.language = app.getSettingsItem('lang') ? app.getSettingsItem('lang') : (navigator.language || navigator.userLanguage).split('-')[0];
|
|
|
|
state.viewStates = {};
|
|
|
|
state.isLoggedIn = false;
|
|
|
|
state.i18n = new I18n(state); // Global I18n class passed to all views
|
2019-09-25 20:32:52 +02:00
|
|
|
}
|