From 18bec85aa07ec92b0fb1e249223b64cdebd3e7d9 Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:02:14 +0800 Subject: [PATCH] feat(campaign): skip avatar shuffling if it does not exceed the max count --- src/views/CampaignDetail/SideParticipants/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/CampaignDetail/SideParticipants/index.tsx b/src/views/CampaignDetail/SideParticipants/index.tsx index c953bf2704..5181248209 100644 --- a/src/views/CampaignDetail/SideParticipants/index.tsx +++ b/src/views/CampaignDetail/SideParticipants/index.tsx @@ -85,6 +85,10 @@ const SideParticipants = ({ campaign }: SideParticipantsProps) => { return [] } + if (edges.length <= maxAvatarCount) { + return edges + } + const withAvatars = edges.filter( ({ node }) => node.avatar && node.id !== viewer.id )