From e2742bc8590d2dd51754155cdde75cd5d57f8473 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Fri, 10 May 2019 17:15:39 +0200
Subject: [PATCH] Fix delete function

---
 .../shared/comment-list/comment-list.component.ts          | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts
index edbaadb4c..ec66381a9 100644
--- a/src/app/components/shared/comment-list/comment-list.component.ts
+++ b/src/app/components/shared/comment-list/comment-list.component.ts
@@ -140,6 +140,13 @@ export class CommentListComponent implements OnInit {
           }
         }
         break;
+      case 'CommentDeleted':
+        for (let i = 0; i < this.comments.length; i++) {
+          this.comments = this.comments.filter(function (el) {
+            return el.id !== payload.id;
+          });
+        }
+        break;
     }
   }
 
-- 
GitLab