Skip to content

Commit

Permalink
Merge branch 'rm/347786' into 'master'
Browse files Browse the repository at this point in the history
prevent multiple registrations of AI plugin

See merge request kchat/webapp!874
  • Loading branch information
antonbuks committed Aug 14, 2024
2 parents 6d5bada + 94e8a79 commit abac1c0
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 abac1c0

Please sign in to comment.