From 09b20cadd8ae811137e54fc5d54c3051181b01ab Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 21 Oct 2022 16:48:48 +0200 Subject: [PATCH] Parallelize plug loads --- web/editor.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/editor.tsx b/web/editor.tsx index 10e0ed2..b9f52fb 100644 --- a/web/editor.tsx +++ b/web/editor.tsx @@ -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"); }