Skip to content

Commit

Permalink
14
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Jan 27, 2020
1 parent 3aa61ac commit d6a6a21
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/subapp-web/src/subapp-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
} else if (subApp.start && subApp.info) {
const queue = ols[name];
ols[name] = undefined;
for (let ix = 0; ix < queue.length; ix++) {
let options = queue[ix];
queue.forEach(options => {
if (!options.id || !options.elementId) {
options = xv1.copyObject(options);
options._genId = options.name + "_inst_id_" + runtimeInfo.instId++;
Expand All @@ -95,18 +94,17 @@
const instance = subApp.preStart(options);
// async prepare needed, await for it and then start
if (instance._prepared.then) {
instance._prepared.then(() => {
return instance._prepared.then(() => {
return subApp.start(options, subApp.info);
});
continue;
}
// no async needed, continue down to start
}

setTimeout(() => {
subApp.start(options, subApp.info);
}, delay++);
}
});
} else {
console.error(`subApp ${name} exist but missing start and info`);
}
Expand Down

0 comments on commit d6a6a21

Please sign in to comment.