-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
25 lines (24 loc) · 734 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import initTheme from './modules/initTheme.js';
import themeHandler from './modules/themeHandler.js';
import * as ls from './modules/localStorage.js';
import xhrHandler from './modules/xhrHandler.js';
import neighborhoodHandler from './modules/neighborhoodHandler.js';
(function() {
if (ls.isAvailable()) {
// Delete old data
if (ls.get('NEIGHBORHOODS')) {
ls.remove('NEIGHBORHOODS');
}
if (!ls.get('NEIGHBORHOODSv2')) {
console.log(
'localstorage.NEIGHBORHOODSv2 does not yet exist, but soon should.'
);
xhrHandler(true);
} else {
console.log('Awesome, localstorage.NEIGHBORHOODSv2 exists!');
neighborhoodHandler();
}
} else {
xhrHandler(false);
}
})();