Skip to content

Commit

Permalink
Fix unread
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait committed Oct 29, 2023
1 parent 91cc30e commit b0030f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/routes/(app)/home/FollowingTimeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
const identifier = findIdentifier(event.tags);
if (identifier === 'notifications/lastOpened') {
console.log('[last read]', event);
$lastReadAt = event.created_at;
$unreadEvents = [];
} else if (identifier !== undefined) {
console.log('[people list]', event);
Expand Down Expand Up @@ -402,7 +403,7 @@
// Past notification
const notificationTimeline = new NotificationTimeline($pubkey);
const notifiedEventItems = await notificationTimeline.fetch(now, $lastReadAt);
$unreadEvents.push(...notifiedEventItems);
$unreadEvents.push(...notifiedEventItems.filter(x => x.event.created_at > $lastReadAt));
$unreadEvents = $unreadEvents;
$notifiedEvents = notifiedEventItems;
$loadingNotifications = false;
Expand Down

0 comments on commit b0030f0

Please sign in to comment.