*Add plugin emit for plugins loaded

This commit is contained in:
Derrick Hammer 2022-12-18 11:42:50 -05:00
parent f849579156
commit 2db95ff746
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 4 deletions

View File

@ -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");
}