Fix a transition initilization after deleting a subcategory

This commit is contained in:
Konstantinos Triantafyllou 2022-09-08 15:10:01 +03:00
parent 3d6cbf8b3e
commit c1bc7b6a5a
1 changed files with 4 additions and 4 deletions

View File

@ -460,15 +460,15 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
this.subCategoryIndexSubject.next(subcategoryIndex);
}
subCategoryChanged(callback: Function, save: boolean = false) {
if(this.subCategories && save) {
subCategoryChanged(callback: Function) {
if(this.subCategories) {
this.subCategories.disable();
}
if(callback) {
callback();
}
this.cdr.detectChanges();
if(this.subCategories && save) {
if(this.subCategories) {
this.subCategories.init();
this.subCategories.enable();
}
@ -527,7 +527,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent {
} else {
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index] = HelperFunctions.copy(subCategory);
}
}, true);
});
};
if (this.index === -1) {
this.save('Subcategory has been successfully created', path, this.form.value, callback);