deduplicate authors

This commit is contained in:
Samuel Newman
2025-07-01 07:49:15 +03:00
parent c802030a94
commit 29c7ed6890
3 changed files with 10 additions and 3 deletions
@@ -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({
<EmptyState icon="growth" message={_(msg`No posts here`)} />
)}
disablePoll
renderEndOfFeed={() => <ListFooter />}
/>
</Layout.Screen>
)
+2 -1
View File
@@ -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
@@ -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' ? (
<View style={[a.pt_2xs]}>
<AdditionalPostText post={item.subject} />
</View>