Skip to content

Commit

Permalink
* xover.init - replaced hardcoded loading.xslt by a xover-initialized…
Browse files Browse the repository at this point in the history
… listener dispatcher
  • Loading branch information
uriel-online committed May 18, 2024
1 parent 936210c commit 616b7a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xo.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ xover.delay = function (ms) {


xover.init = async function () {
let progress;
let progress_renders = [];
this.init.initializing = this.init.initializing || xover.delay(1).then(async () => {
try {
await xover.modernize();
Expand All @@ -545,7 +545,7 @@ xover.init = async function () {
if (history.state) delete history.state.active;
xover.site.seed = (history.state || {}).seed || top.location.hash || '#';
this.init.status = 'initialized';
progress = xover.sources['loading.xslt'].render({ action: "append" });
window.top.dispatchEvent(new xover.listener.Event('xover-initialized', { progress_renders }, this));
if (xover.session.status == 'authorized' && 'session' in xover.server) {
await xover.session.checkStatus();
}
Expand All @@ -567,8 +567,8 @@ xover.init = async function () {
/*return*/ Promise.reject(e); // Ommited return to prevent hitting multiple times unhandled rejection
}).finally(async () => {
this.init.initializing = 'done';
progress = await progress || [];
progress.forEach(item => item.remove());
progress_renders = await progress_renders || [];
progress_renders.forEach(item => item.remove());
});
return this.init.initializing;
}
Expand Down

0 comments on commit 616b7a5

Please sign in to comment.