Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

refactor(utils): Refactor plugin registration in Plugins class

robin9f912b3824ca
diff --git a/ui/src/utils/pluginKit/index.ts b/ui/src/utils/pluginKit/index.ts
index f53fdb4c..66d5c376 100644
--- a/ui/src/utils/pluginKit/index.ts
+++ b/ui/src/utils/pluginKit/index.ts
@@ -94,11 +94,13 @@ class Plugins {
}
registerPlugins() {
- const plugins = this.registeredPlugins.map((p) => {
- const func = allPlugins[p.slug_name];
+ const plugins = this.registeredPlugins
+ .map((p) => {
+ const func = allPlugins[p.slug_name];
- return func;
- });
+ return func;
+ })
+ .filter((p) => p);
return new Promise((resolve) => {
plugins.forEach(async (p) => {
const plugin = await p();