From 94424a8317f301191b6b19edca239bb5cdf58c9a Mon Sep 17 00:00:00 2001 From: Konstantinos Triantafyllou Date: Tue, 8 Dec 2020 10:09:15 +0000 Subject: [PATCH] [Monitor Dashboard | Trunk]: Fix a bug with delete topic git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@60094 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/topic/topic.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {