Parallelize plug loads

pull/109/head
Zef Hemel 2022-10-21 16:48:48 +02:00
parent c1a78e0105
commit 09b20cadd8
1 changed files with 2 additions and 3 deletions

View File

@ -528,11 +528,10 @@ export class Editor {
await this.space.updatePageList();
await this.system.unloadAll();
console.log("(Re)loading plugs");
for (const plugName of await this.space.listPlugs()) {
// console.log("Loading plug", pageInfo.name);
await Promise.all((await this.space.listPlugs()).map(async (plugName) => {
const { data } = await this.space.readAttachment(plugName, "string");
await this.system.load(JSON.parse(data as string), createIFrameSandbox);
}
}));
this.rebuildEditorState();
await this.dispatchAppEvent("plugs:loaded");
}