From 44db4bb40e72e0db947f0677e91f0721dfa3c466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 17 Apr 2019 16:07:29 +0200 Subject: [PATCH] Make sure we always reset the comments collection if the id changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/controller/ActivityController.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/controller/ActivityController.js b/js/controller/ActivityController.js index 6e1cd6b68..c521067ff 100644 --- a/js/controller/ActivityController.js +++ b/js/controller/ActivityController.js @@ -46,10 +46,11 @@ class ActivityController { this.$scope.$watch(function () { return self.element.id; }, function (params) { + if (self.type === 'deck_card') { + self.activityservice.loadComments(self.element.id); + } + if (self.getData(self.element.id).length === 0) { - if (self.type === 'deck_card') { - self.activityservice.loadComments(self.element.id); - } self.loading = true; self.fetchUntilResults(); }