From 2db95ff746ef8bae45c1b390a085cf329187aa0d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 18 Dec 2022 11:42:50 -0500 Subject: [PATCH] *Add plugin emit for plugins loaded --- src/modules/plugin.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/plugin.ts b/src/modules/plugin.ts index 4434d8d..cceb17a 100644 --- a/src/modules/plugin.ts +++ b/src/modules/plugin.ts @@ -159,12 +159,14 @@ export function getPluginAPIManager(): PluginAPIManager { } export async function loadPlugins() { - const api = getPluginAPIManager(); + const apiManager = getPluginAPIManager(); - api.loadPluginInstance(pluginCore); - api.loadPluginInstance(pluginRpc); + apiManager.loadPluginInstance(pluginCore); + apiManager.loadPluginInstance(pluginRpc); for (const plugin of [...new Set(config.array("plugins", []))] as []) { - api.loadPlugin(plugin); + await apiManager.loadPlugin(plugin); } + + getPluginAPI().emit("core.pluginsLoaded"); }