mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
No need for rl.initData
This commit is contained in:
parent
145c11d58e
commit
4d8f7d2af7
1 changed files with 16 additions and 18 deletions
34
dev/boot.js
34
dev/boot.js
|
|
@ -60,23 +60,6 @@ window.rl = {
|
||||||
setTitle: title =>
|
setTitle: title =>
|
||||||
doc.title = (title || '') + (RL_APP_DATA.title ? (title ? ' - ' : '') + RL_APP_DATA.title : ''),
|
doc.title = (title || '') + (RL_APP_DATA.title ? (title ? ' - ' : '') + RL_APP_DATA.title : ''),
|
||||||
|
|
||||||
initData: appData => {
|
|
||||||
RL_APP_DATA = appData;
|
|
||||||
const url = appData.StaticLibsJs,
|
|
||||||
cb = () => rl.app.bootstart();
|
|
||||||
loadScript(url)
|
|
||||||
.then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`)))
|
|
||||||
.then(() => appData.PluginsLink ? loadScript(qUri(appData.PluginsLink)) : Promise.resolve())
|
|
||||||
.then(() => rl.app
|
|
||||||
? cb()
|
|
||||||
: doc.addEventListener('readystatechange', () => 'complete' == doc.readyState && cb())
|
|
||||||
)
|
|
||||||
.catch(e => {
|
|
||||||
showError(e);
|
|
||||||
throw e;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
setData: appData => {
|
setData: appData => {
|
||||||
RL_APP_DATA = appData;
|
RL_APP_DATA = appData;
|
||||||
rl.app.refresh();
|
rl.app.refresh();
|
||||||
|
|
@ -164,7 +147,22 @@ if (!navigator.cookieEnabled) {
|
||||||
eId('BadBrowser').hidden = false;
|
eId('BadBrowser').hidden = false;
|
||||||
} else {
|
} else {
|
||||||
rl.fetchJSON(qUri(`${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`))
|
rl.fetchJSON(qUri(`${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`))
|
||||||
.then(data => rl.initData(data))
|
.then(appData => {
|
||||||
|
RL_APP_DATA = appData;
|
||||||
|
const url = appData.StaticLibsJs,
|
||||||
|
cb = () => rl.app.bootstart();
|
||||||
|
loadScript(url)
|
||||||
|
.then(() => loadScript(url.replace('/libs.', `/${admin?'admin':'app'}.`)))
|
||||||
|
.then(() => appData.PluginsLink ? loadScript(qUri(appData.PluginsLink)) : Promise.resolve())
|
||||||
|
.then(() => rl.app
|
||||||
|
? cb()
|
||||||
|
: doc.addEventListener('readystatechange', () => 'complete' == doc.readyState && cb())
|
||||||
|
)
|
||||||
|
.catch(e => {
|
||||||
|
showError(e);
|
||||||
|
throw e;
|
||||||
|
});
|
||||||
|
})
|
||||||
.catch(e => showError(e));
|
.catch(e => showError(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue