Skip to content

Commit 3edb13d

Browse files
re-render alerts table on comment setting update (#1085) (#1087)
(cherry picked from commit 98fa437) Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 84722bc commit 3edb13d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default class AlertsDashboardFlyoutComponent extends Component {
121121
});
122122
}
123123

124-
componentDidUpdate(prevProps, prevState) {
124+
componentDidUpdate(_prevProps, prevState) {
125125
const prevQuery = getQueryObjectFromState(prevState);
126126
const currQuery = getQueryObjectFromState(this.state);
127127
if (!_.isEqual(prevQuery, currQuery)) {
@@ -146,10 +146,11 @@ export default class AlertsDashboardFlyoutComponent extends Component {
146146
monitorIds
147147
);
148148
}
149-
const { monitorType } = this.state;
149+
const { monitorType, commentsEnabled, tabId } = this.state;
150150
if (
151-
[MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
152-
!_.isEqual(prevState.selectedItems, this.state.selectedItems)
151+
([MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
152+
!_.isEqual(prevState.selectedItems, this.state.selectedItems)) ||
153+
(tabId === TABLE_TAB_IDS.ALERTS.id && commentsEnabled !== prevState.commentsEnabled)
153154
)
154155
this.setState({ tabContent: this.renderAlertsTable() });
155156
}

0 commit comments

Comments
 (0)