mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
cleanup boot.js
This commit is contained in:
parent
31d9ea53b9
commit
07b002a66a
1 changed files with 11 additions and 15 deletions
26
dev/boot.js
26
dev/boot.js
|
|
@ -11,9 +11,9 @@ const
|
|||
Storage = type => {
|
||||
let name = type+'Storage';
|
||||
try {
|
||||
win[name].setItem('storage', '');
|
||||
win[name].getItem('storage');
|
||||
win[name].removeItem('storage');
|
||||
win[name].setItem(name, '');
|
||||
win[name].getItem(name);
|
||||
win[name].removeItem(name);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
const cookieName = encodeURIComponent(name+('session' === type ? win.name || (win.name = Date.now()) : ''));
|
||||
|
|
@ -47,14 +47,6 @@ const
|
|||
p.end();
|
||||
},
|
||||
|
||||
runMainBoot = withError => {
|
||||
if (win.__APP_BOOT && !withError) {
|
||||
win.__APP_BOOT(() => showError());
|
||||
} else {
|
||||
showError();
|
||||
}
|
||||
},
|
||||
|
||||
writeCSS = css => {
|
||||
const style = doc.createElement('style');
|
||||
style.type = 'text/css';
|
||||
|
|
@ -190,11 +182,15 @@ win.__initAppData = appData => {
|
|||
return appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve();
|
||||
})
|
||||
.then(() => {
|
||||
p.set(70);
|
||||
runMainBoot(false);
|
||||
if (win.__APP_BOOT) {
|
||||
p.set(70);
|
||||
win.__APP_BOOT(() => showError());
|
||||
} else {
|
||||
showError();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
runMainBoot(true);
|
||||
showError();
|
||||
throw e;
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -206,7 +202,7 @@ win.__initAppData = appData => {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
runMainBoot(true);
|
||||
showError();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue