I am rendering the component based on the JIRA.Events.NEW_CONTENT_ADDED. Once component mounted, I am calling the rest API. But in Issue Web Module, the JIRA.Events.NEW_CONTENT_ADDED is called multiple times. So my rest call is called multiple times and affects the Performance.
I am using the following code
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, (e, context, reason) => {
if (reason == JIRA.CONTENT_ADDED_REASON.panelRefreshed) {
if (context[0] != null && context[0].id === 'templates_on_issue_view') {
const divToLoad = document.getElementById('issue_view_container');
if (divToLoad) {
ReactDOM.render(<IssueViewPanel />, divToLoad);
}
}
}
});
Please help me to resolve the issue?