[ACS-7366] fix infinite re-rendering (#3739)

This commit is contained in:
Mykyta Maliarchuk
2024-03-28 13:01:05 +01:00
committed by GitHub
parent e283b50ef0
commit b4dc7be2ad
6 changed files with 38 additions and 22 deletions
@@ -60,7 +60,7 @@
<div class="aca-manage-rules__container" *ngIf="isMainRuleSetNotEmpty || isInheritedRuleSetsNotEmpty; else emptyContent">
<aca-rule-list
[mainRuleSet]="mainRuleSet$ | async"
[mainRuleSet$]="mainRuleSet$"
[folderId]="nodeId"
[inheritedRuleSets]="inheritedRuleSets$ | async"
[hasMoreRuleSets]="hasMoreRuleSets$ | async"
@@ -211,7 +211,8 @@ export class ManageRulesSmartComponent implements OnInit, OnDestroy {
}
async onRuleEnabledToggle(rule: Rule, isEnabled: boolean) {
await this.folderRulesService.updateRule(this.nodeId, rule.id, { ...rule, isEnabled });
const updatedRule = await this.folderRulesService.updateRule(this.nodeId, rule.id, { ...rule, isEnabled });
this.folderRuleSetsService.addOrUpdateRuleInMainRuleSet(updatedRule);
}
async onInheritanceToggleChange(event: MatSlideToggleChange) {