This is an automated email from the ASF dual-hosted git repository.

robin0716 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 9f912b38 refactor(utils): Refactor plugin registration in Plugins class
9f912b38 is described below

commit 9f912b3824ca18d81137d8380844f778795bec28
Author: robin <[email protected]>
AuthorDate: Sat Oct 12 15:15:34 2024 +0800

    refactor(utils): Refactor plugin registration in Plugins class
---
 ui/src/utils/pluginKit/index.ts | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

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();

Reply via email to