diff --git a/packages/subapp-web/src/subapp-web.js b/packages/subapp-web/src/subapp-web.js index b40e1206b..9c2fa50aa 100644 --- a/packages/subapp-web/src/subapp-web.js +++ b/packages/subapp-web/src/subapp-web.js @@ -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++; @@ -95,10 +94,9 @@ 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 } @@ -106,7 +104,7 @@ setTimeout(() => { subApp.start(options, subApp.info); }, delay++); - } + }); } else { console.error(`subApp ${name} exist but missing start and info`); }