mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-7366] fix infinite re-rendering (#3739)
This commit is contained in:
committed by
GitHub
parent
e283b50ef0
commit
b4dc7be2ad
@@ -210,8 +210,8 @@ export class FolderRuleSetsService {
|
||||
this.mainRuleSet.rules.splice(index, 1);
|
||||
} else {
|
||||
this.mainRuleSet = null;
|
||||
this.mainRuleSetSource.next(this.mainRuleSet);
|
||||
}
|
||||
this.mainRuleSetSource.next(this.mainRuleSet);
|
||||
this.folderRulesService.selectRule(this.mainRuleSet?.rules[0] ?? this.inheritedRuleSets[0]?.rules[0] ?? null);
|
||||
}
|
||||
}
|
||||
@@ -225,6 +225,7 @@ export class FolderRuleSetsService {
|
||||
} else {
|
||||
this.mainRuleSet.rules.push(newRule);
|
||||
}
|
||||
this.mainRuleSetSource.next(this.mainRuleSet);
|
||||
this.folderRulesService.selectRule(newRule);
|
||||
} else {
|
||||
this.refreshMainRuleSet(newRule);
|
||||
@@ -234,6 +235,9 @@ export class FolderRuleSetsService {
|
||||
refreshMainRuleSet(ruleToSelect: Rule = null) {
|
||||
this.getMainRuleSet(this.currentFolder.id).subscribe((mainRuleSet: RuleSet) => {
|
||||
this.mainRuleSet = { ...mainRuleSet };
|
||||
if (!this.mainRuleSet.rules) {
|
||||
this.mainRuleSet = null;
|
||||
}
|
||||
this.mainRuleSetSource.next(this.mainRuleSet);
|
||||
if (mainRuleSet) {
|
||||
const ruleToSelectInRuleSet = ruleToSelect ? mainRuleSet.rules.find((rule: Rule) => rule.id === ruleToSelect.id) : mainRuleSet.rules[0];
|
||||
|
Reference in New Issue
Block a user