Fix loading if no comments are available

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-10-09 17:41:41 +02:00
parent 72fd0fcc9b
commit 33dbbd0d62
3 changed files with 11 additions and 5 deletions

View File

@@ -124,7 +124,7 @@ class ActivityService {
self.running = false;
return response;
}, function (error) {
if (error.status === 304) {
if (error.status === 304 || error.status === 404) {
self.since[type][id].finished = true;
}
self.running = false;
@@ -140,7 +140,9 @@ class ActivityService {
if (!this.since[type][id].finished) {
this.runningPromise = this.fetchCardActivities(type, id, this.since[type][id].oldest);
this.runningPromise.then(function() {
self.commentCollection.fetchNext();
if (type === 'deck_card') {
self.commentCollection.fetchNext();
}
});
return this.runningPromise;
}