Skip to content

Commit

Permalink
re-render alerts table on comment setting update (#1085)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
  • Loading branch information
amsiglan committed Sep 10, 2024
1 parent 9e35b84 commit 98fa437
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class AlertsDashboardFlyoutComponent extends Component {
});
}

componentDidUpdate(prevProps, prevState) {
componentDidUpdate(_prevProps, prevState) {
const prevQuery = getQueryObjectFromState(prevState);
const currQuery = getQueryObjectFromState(this.state);
if (!_.isEqual(prevQuery, currQuery)) {
Expand All @@ -146,10 +146,11 @@ export default class AlertsDashboardFlyoutComponent extends Component {
monitorIds
);
}
const { monitorType } = this.state;
const { monitorType, commentsEnabled, tabId } = this.state;
if (
[MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
!_.isEqual(prevState.selectedItems, this.state.selectedItems)
([MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
!_.isEqual(prevState.selectedItems, this.state.selectedItems)) ||
(tabId === TABLE_TAB_IDS.ALERTS.id && commentsEnabled !== prevState.commentsEnabled)
)
this.setState({ tabContent: this.renderAlertsTable() });
}
Expand Down

0 comments on commit 98fa437

Please sign in to comment.