mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +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 => {
|
Storage = type => {
|
||||||
let name = type+'Storage';
|
let name = type+'Storage';
|
||||||
try {
|
try {
|
||||||
win[name].setItem('storage', '');
|
win[name].setItem(name, '');
|
||||||
win[name].getItem('storage');
|
win[name].getItem(name);
|
||||||
win[name].removeItem('storage');
|
win[name].removeItem(name);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
const cookieName = encodeURIComponent(name+('session' === type ? win.name || (win.name = Date.now()) : ''));
|
const cookieName = encodeURIComponent(name+('session' === type ? win.name || (win.name = Date.now()) : ''));
|
||||||
|
|
@ -47,14 +47,6 @@ const
|
||||||
p.end();
|
p.end();
|
||||||
},
|
},
|
||||||
|
|
||||||
runMainBoot = withError => {
|
|
||||||
if (win.__APP_BOOT && !withError) {
|
|
||||||
win.__APP_BOOT(() => showError());
|
|
||||||
} else {
|
|
||||||
showError();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
writeCSS = css => {
|
writeCSS = css => {
|
||||||
const style = doc.createElement('style');
|
const style = doc.createElement('style');
|
||||||
style.type = 'text/css';
|
style.type = 'text/css';
|
||||||
|
|
@ -190,11 +182,15 @@ win.__initAppData = appData => {
|
||||||
return appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve();
|
return appData.PluginsLink ? loadScript(appData.PluginsLink) : Promise.resolve();
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
p.set(70);
|
if (win.__APP_BOOT) {
|
||||||
runMainBoot(false);
|
p.set(70);
|
||||||
|
win.__APP_BOOT(() => showError());
|
||||||
|
} else {
|
||||||
|
showError();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
runMainBoot(true);
|
showError();
|
||||||
throw e;
|
throw e;
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
@ -206,7 +202,7 @@ win.__initAppData = appData => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
runMainBoot(true);
|
showError();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue