Make sure we always reset the comments collection if the id changes

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-04-17 16:07:29 +02:00
parent 7e8f4c83b3
commit 44db4bb40e

View File

@@ -46,10 +46,11 @@ class ActivityController {
this.$scope.$watch(function () { this.$scope.$watch(function () {
return self.element.id; return self.element.id;
}, function (params) { }, function (params) {
if (self.type === 'deck_card') {
self.activityservice.loadComments(self.element.id);
}
if (self.getData(self.element.id).length === 0) { if (self.getData(self.element.id).length === 0) {
if (self.type === 'deck_card') {
self.activityservice.loadComments(self.element.id);
}
self.loading = true; self.loading = true;
self.fetchUntilResults(); self.fetchUntilResults();
} }