tighten AvatarBubbles profiles type to non-nullable
Now that the count prop drives placeholder slots, callers no longer need to pad the profiles array with undefined, so the prop can be AnyProfileView[]. Drops the now-dead falsy check in the self-filter and the defensive ?? undefined at the one call site that had it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,7 @@ export function AvatarBubbles({
|
||||
count,
|
||||
}: {
|
||||
animate?: boolean
|
||||
profiles: (bsky.profile.AnyProfileView | undefined)[]
|
||||
profiles: bsky.profile.AnyProfileView[]
|
||||
/**
|
||||
* By default, when there are more than 2 profiles, the current user is
|
||||
* filtered out (so you don't see yourself among your own group's members).
|
||||
@@ -54,7 +54,7 @@ export function AvatarBubbles({
|
||||
const {currentAccount} = useSession()
|
||||
const profiles =
|
||||
!self && allProfiles.length > 2
|
||||
? allProfiles.filter(p => !p || p.did !== currentAccount?.did)
|
||||
? allProfiles.filter(p => p.did !== currentAccount?.did)
|
||||
: allProfiles
|
||||
|
||||
const bubbleCount = Math.max(profiles.length, count ?? 0)
|
||||
|
||||
@@ -63,7 +63,7 @@ export function OutgoingRequestListItem({
|
||||
(hovered || pressed || focused) && t.atoms.bg_contrast_25,
|
||||
]}>
|
||||
<AvatarBubbles
|
||||
profiles={[convoView?.owner ?? undefined]}
|
||||
profiles={[convoView.owner]}
|
||||
count={convoView.memberCount}
|
||||
size={48}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user