lexiconga-lite/src/index.js

30 lines
763 B
JavaScript
Raw Normal View History

2019-05-02 10:57:56 -06:00
import './main.scss';
2019-05-02 15:45:10 -06:00
import setupListeners from './js/setupListeners';
import { renderAll } from './js/render';
import { generateRandomWords, addMessage, hasToken } from './js/utilities';
import { loadDictionary } from './js/dictionaryManagement';
import { loadSettings } from './js/settings';
2019-05-02 15:45:10 -06:00
2019-05-02 10:57:56 -06:00
function initialize() {
2019-05-09 14:34:32 -06:00
addMessage('Loading...');
if (hasToken()) {
import('./js/account/index.js').then(account => {
account.loginWithToken();
});
}
loadDictionary();
loadSettings();
2019-05-08 13:01:39 -06:00
// generateRandomWords(100);
2019-05-02 15:45:10 -06:00
setupListeners();
renderAll();
2019-05-08 17:13:23 -06:00
addMessage('Done Loading!');
2019-05-08 13:01:39 -06:00
// console.log('Rendered!');
2019-05-02 10:57:56 -06:00
}
window.onload = (function (oldLoad) {
return function () {
oldLoad && oldLoad();
initialize();
}
})(window.onload);