From 94e8a796b635a750018aa54ea7cb66741fbf01e8 Mon Sep 17 00:00:00 2001 From: Boris Trombert Date: Wed, 14 Aug 2024 08:54:41 +0200 Subject: [PATCH] prevent multiple registrations of AI plugin Changelog: fixed --- webapp/channels/src/actions/ai_actions.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/channels/src/actions/ai_actions.tsx b/webapp/channels/src/actions/ai_actions.tsx index e0a77bab43..ddf59a0f62 100644 --- a/webapp/channels/src/actions/ai_actions.tsx +++ b/webapp/channels/src/actions/ai_actions.tsx @@ -5,8 +5,13 @@ import {generateId} from 'utils/utils'; import PostMenu from 'plugins/ai/components/post_menu'; +let isPluginRegistered = false; + export function registerInternalAiPlugin() { return async (dispatch: DispatchFunc) => { + if (isPluginRegistered) { + return; + } dispatch({ type: ActionTypes.RECEIVED_PLUGIN_COMPONENT, name: 'PostAction', @@ -16,5 +21,6 @@ export function registerInternalAiPlugin() { component: PostMenu, }, }); + isPluginRegistered = true; }; }