mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 09:17:03 +00:00
Update NotificationCard, fix missing status bug
This commit is contained in:
parent
ef63124d88
commit
a3a86d46a1
1 changed files with 21 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue