Skip to content

Commit

Permalink
Remove resources of deleted categories from cache when saving configu…
Browse files Browse the repository at this point in the history
…ration [notarize]
  • Loading branch information
tkleinke committed Jun 15, 2022
1 parent ae68891 commit 2eeec08
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ export class ConfigurationComponent implements OnInit, OnDestroy {

private async reindex() {

this.updateDocumentCache();

Tree.flatten(this.projectConfiguration.getCategories()).forEach(category => {
CategoryForm.getFields(category).forEach(field => {
this.indexFacade.addConstraintIndexDefinitionsForField(field);
Expand All @@ -750,4 +752,12 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
true
);
}


private updateDocumentCache() {

this.documentCache.getAll().filter(document => {
return !this.projectConfiguration.getCategory(document.resource.category);
}).forEach(document => this.documentCache.remove(document.resource.id));
}
}

0 comments on commit 2eeec08

Please sign in to comment.