[Plugins] Properly await plugin start in initialization

This commit is contained in:
redstonekasi 2023-02-08 10:41:22 +01:00 committed by Beef
parent fec4c68f70
commit c2ebff3e93

View file

@ -123,8 +123,8 @@ export async function initPlugins() {
await awaitSyncWrapper(plugins); await awaitSyncWrapper(plugins);
const allIds = Object.keys(plugins); const allIds = Object.keys(plugins);
await Promise.allSettled(allIds.filter(pl => plugins[pl].enabled && plugins[pl].update).map(pl => fetchPlugin(pl))); await Promise.allSettled(allIds.filter(pl => plugins[pl].enabled && plugins[pl].update).map((pl) => fetchPlugin(pl)));
for (const pl of allIds.filter(pl => plugins[pl].enabled)) startPlugin(pl); await Promise.allSettled(allIds.filter(pl => plugins[pl].enabled).map((pl) => startPlugin(pl)));
return stopAllPlugins; return stopAllPlugins;
} }