aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
index 19f179aca95..320c759103e 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx
@@ -467,12 +467,14 @@ export class App extends React.PureComponent<Props, State> {
});
handleRuleDeactivate = (profile: string, rule: string) =>
- this.setState((state: State) => {
+ this.setState(state => {
const { actives } = state;
if (actives && actives[rule]) {
- return { actives: { ...actives, [rule]: { ...actives[rule], [profile]: undefined } } };
+ const newRule = { ...actives[rule] };
+ delete newRule[profile];
+ return { actives: { ...actives, [rule]: newRule } };
}
- return {};
+ return null;
});
handleSearch = (searchQuery: string) => this.handleFilterChange({ searchQuery });