lexiconga-lite/src/index.js

28 lines
613 B
JavaScript
Raw Normal View History

2019-05-02 18:57:56 +02:00
import './main.scss';
2019-05-02 23:45:10 +02:00
import setupListeners from './js/setupListeners';
import { renderAll } from './js/render';
import { hasToken } from './js/utilities';
import { loadDictionary } from './js/dictionaryManagement';
import { loadSettings } from './js/settings';
2019-05-02 23:45:10 +02:00
2019-05-02 18:57:56 +02:00
function initialize() {
loadDictionary();
loadSettings();
setupListeners();
if (hasToken()) {
import('./js/account/index.js').then(account => {
account.loginWithToken();
});
}
renderAll();
2019-05-02 18:57:56 +02:00
}
window.onload = (function (oldLoad) {
return function () {
oldLoad && oldLoad();
initialize();
}
})(window.onload);