mirror of
https://gitlab.com/Alamantus/Readlebee.git
synced 2025-07-12 02:55:57 +02:00
- Split initialization steps into their own files. - Use Choo routes instead of viewManager to properly set up 404 - Add styling for different colors of Picnic cards
16 lines
No EOL
548 B
JavaScript
16 lines
No EOL
548 B
JavaScript
export const appState = (app, state, emitter) => {
|
|
const sessionState = app.getSessionState();
|
|
if (sessionState) {
|
|
Object.keys(sessionState).forEach(key => {
|
|
if (typeof state[key] === 'undefined') {
|
|
state[key] = sessionState[key];
|
|
}
|
|
});
|
|
} else {
|
|
// Default state variables
|
|
state.currentView = 'home';
|
|
state.language = app.getSettingsItem('lang') ? app.getSettingsItem('lang') : (navigator.language || navigator.userLanguage).split('-')[0];
|
|
state.viewStates = {};
|
|
state.isLoggedIn = false;
|
|
}
|
|
} |