Skip to content

Commit

Permalink
prevent multiple registrations of AI plugin
Browse files Browse the repository at this point in the history
Changelog: fixed
  • Loading branch information
Boris Trombert committed Aug 14, 2024
1 parent 6d5bada commit 94e8a79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/channels/src/actions/ai_actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -16,5 +21,6 @@ export function registerInternalAiPlugin() {
component: PostMenu,
},
});
isPluginRegistered = true;
};
}

0 comments on commit 94e8a79

Please sign in to comment.