From 29c7ed689080c1c915cbd8736880ca4282ac544a Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 1 Jul 2025 07:49:15 +0300 Subject: [PATCH] deduplicate authors --- src/screens/Notifications/ActivityList.tsx | 2 ++ src/state/queries/notifications/util.ts | 3 ++- src/view/com/notifications/NotificationFeedItem.tsx | 8 ++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/screens/Notifications/ActivityList.tsx b/src/screens/Notifications/ActivityList.tsx index 560f860972..8ee93abafa 100644 --- a/src/screens/Notifications/ActivityList.tsx +++ b/src/screens/Notifications/ActivityList.tsx @@ -6,6 +6,7 @@ import {type AllNavigatorParams} from '#/lib/routes/types' import {PostFeed} from '#/view/com/posts/PostFeed' import {EmptyState} from '#/view/com/util/EmptyState' import * as Layout from '#/components/Layout' +import {ListFooter} from '#/components/Lists' type Props = NativeStackScreenProps< AllNavigatorParams, @@ -36,6 +37,7 @@ export function NotificationsActivityListScreen({ )} disablePoll + renderEndOfFeed={() => } /> ) diff --git a/src/state/queries/notifications/util.ts b/src/state/queries/notifications/util.ts index 4cb023ebca..faccd80872 100644 --- a/src/state/queries/notifications/util.ts +++ b/src/state/queries/notifications/util.ts @@ -145,7 +145,8 @@ export function groupNotifications( Math.abs(ts2 - ts) < MS_2DAY && notif.reason === groupedNotif.notification.reason && notif.reasonSubject === groupedNotif.notification.reasonSubject && - notif.author.did !== groupedNotif.notification.author.did + (notif.author.did !== groupedNotif.notification.author.did || + notif.reason === 'subscribed-post') ) { const nextIsFollowBack = notif.reason === 'follow' && notif.author.viewer?.following diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 111054446e..b62293546e 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -165,7 +165,10 @@ let NotificationFeedItem = ({ href: makeProfileLink(author), moderation: moderateProfile(author, moderationOpts), })) || []), - ] + ].filter( + (author, index, arr) => + arr.findIndex(au => au.profile.did === author.profile.did) === index, + ) }, [item, moderationOpts]) const niceTimestamp = niceDate(i18n, item.notification.indexedAt) @@ -659,7 +662,8 @@ let NotificationFeedItem = ({ {item.type === 'post-like' || item.type === 'repost' || item.type === 'like-via-repost' || - item.type === 'repost-via-repost' ? ( + item.type === 'repost-via-repost' || + item.type === 'subscribed-post' ? (