From 97b7bca25562fe4e4bfbb7bba1191a7601b47b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 6 Oct 2018 12:42:31 +0200 Subject: [PATCH] Fix eslint errors 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 | 4 ++-- js/service/ActivityService.js | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/controller/ActivityController.js b/js/controller/ActivityController.js index f964b5300..ad7c1f344 100644 --- a/js/controller/ActivityController.js +++ b/js/controller/ActivityController.js @@ -94,8 +94,8 @@ class ActivityController { }); $target.on('inserted.atwho', function (je, $el) { $(je.target).find( - 'span[data-username="' + $el.find('[data-username]').data('username') + '"]' - ).avatar(); + 'span[data-username="' + $el.find('[data-username]').data('username') + '"]' + ).avatar(); }); } diff --git a/js/service/ActivityService.js b/js/service/ActivityService.js index 1f932420c..2b5859f36 100644 --- a/js/service/ActivityService.js +++ b/js/service/ActivityService.js @@ -48,10 +48,12 @@ class ActivityService { }, this); this.commentCollection.on('sync', function(a) { for (let index in this.toEnhanceWithComments) { - let item = this.toEnhanceWithComments[index]; - item.commentModel = this.commentCollection.get(item.subject_rich[1].comment); - if (typeof item.commentModel !== 'undefined') { - this.toEnhanceWithComments = this.toEnhanceWithComments.filter(entry => entry.id !== item.id); + if (this.toEnhanceWithComments.hasOwnProperty(index)) { + let item = this.toEnhanceWithComments[index]; + item.commentModel = this.commentCollection.get(item.subject_rich[1].comment); + if (typeof item.commentModel !== 'undefined') { + this.toEnhanceWithComments = this.toEnhanceWithComments.filter(entry => entry.id !== item.id); + } } } var firstUnread = this.commentCollection.findWhere({isUnread: true});