diff --git a/src/app/topic/topic.component.ts b/src/app/topic/topic.component.ts index 23e4f90..4fcf17e 100644 --- a/src/app/topic/topic.component.ts +++ b/src/app/topic/topic.component.ts @@ -234,15 +234,15 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent { this.deleteOpen(childrenAction); } - public deleteTopic(index = this.topicIndex) { + public deleteTopic() { let path: string[] = [ this.stakeholder._id, - this.stakeholder.topics[index]._id + this.stakeholder.topics[this.index]._id ]; let callback = (): void => { - this.stakeholder.topics.splice(index, 1); + this.stakeholder.topics.splice(this.index, 1); }; - this.delete('Topic has been successfully be deleted', path, callback, true); + this.delete('Topic has been successfully be deleted', path, callback, (this.topicIndex === this.index)); } public toggleCategory(index: number) {