From 5ae82139dc9379324f1cc21f045917bb229e4b33 Mon Sep 17 00:00:00 2001 From: Rohan-cp Date: Wed, 8 May 2024 22:29:37 +0530 Subject: [PATCH] fix for missing preview cards in search default mobile (#2464) --- .env.sample | 0 .../components/Search/SearchDefaultSuggestedUsersSection.tsx | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .env.sample diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/web/src/components/Search/SearchDefaultSuggestedUsersSection.tsx b/apps/web/src/components/Search/SearchDefaultSuggestedUsersSection.tsx index b227687caf..c00994946e 100644 --- a/apps/web/src/components/Search/SearchDefaultSuggestedUsersSection.tsx +++ b/apps/web/src/components/Search/SearchDefaultSuggestedUsersSection.tsx @@ -24,7 +24,7 @@ export default function SearchDefaultSuggestedUsersSection({ queryRef, variant, fragment SearchDefaultSuggestedUsersSectionFragment on Query { viewer @required(action: THROW) { ... on Viewer { - suggestedUsers(first: 2) @required(action: THROW) { + suggestedUsers(first: 4) @required(action: THROW) { __typename edges { node { @@ -57,7 +57,8 @@ export default function SearchDefaultSuggestedUsersSection({ queryRef, variant, .flatMap((edge) => (edge?.node ? [edge.node] : [])) .filter((user) => user?.galleries?.some((gallery) => removeNullValues(gallery?.tokenPreviews).length > 0) - ); + ) + ?.slice(0, 2); }, [query.viewer.suggestedUsers?.edges]); if (query.viewer?.suggestedUsers?.__typename !== 'UsersConnection' || !nonNullProfiles) {