From a3a86d46a17ab7c3c2e9ba9824cb5325796685d3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 18 Jun 2021 05:29:37 -0600 Subject: [PATCH] Update NotificationCard, fix missing status bug --- .../assets/js/components/NotificationCard.vue | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/NotificationCard.vue b/resources/assets/js/components/NotificationCard.vue index d0109f1f3..a71af0ee9 100644 --- a/resources/assets/js/components/NotificationCard.vue +++ b/resources/assets/js/components/NotificationCard.vue @@ -130,8 +130,19 @@ fetchNotifications() { axios.get('/api/pixelfed/v1/notifications?pg=true') .then(res => { - let data = res.data; - let ids = res.data.map(n => n.id); + let data = res.data.filter(n => { + if(n.type == 'share' && !status) { + return false; + } + if(n.type == 'comment' && !status) { + return false; + } + if(n.type == 'mention' && !status) { + return false; + } + return true; + }); + let ids = data.map(n => n.id); this.notificationMaxId = Math.min(...ids); this.notifications = data; this.loading = false; @@ -154,11 +165,19 @@ if(n.type == 'share' && !status) { return false; } + if(n.type == 'comment' && !status) { + return false; + } + if(n.type == 'mention' && !status) { + return false; + } if(_.find(this.notifications, {id: n.id})) { return false; } return true; }); + let ids = data.map(n => n.id); + this.notificationMaxId = Math.min(...ids); this.notifications.push(...data); this.notificationCursor++; $state.loaded();