Skip to content

Commit

Permalink
add usememo
Browse files Browse the repository at this point in the history
  • Loading branch information
pvicensSpacedev committed May 2, 2024
1 parent 7df6903 commit 464d07d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ function UserGalleryCollections({ galleryRef, queryRef, mobileLayout }: Props) {
}, []);
}, [collections]);

// TODO: Change length to properly reflect virtualizedList onLoad. Some profile's onLoad function not triggering
const filteredTokenIds = useMemo(() => {
return tokenIds ? tokenIds.slice(0, 1) : [];
}, [tokenIds]);

const isAuthenticatedUsersPage = loggedInUserId === owner?.id;

const nonNullCollections = removeNullValues(collections);
Expand Down Expand Up @@ -159,9 +164,6 @@ function UserGalleryCollections({ galleryRef, queryRef, mobileLayout }: Props) {
);
}

// TODO: Change length to properly reflect virtualizedList onLoad. Some profile's onLoad function not triggering
const filteredTokenIds = tokenIds ? tokenIds.slice(0, 1) : [];

return (
<MultiShimmerProvider tokenIdsToLoad={filteredTokenIds}>
<StyledUserGalleryCollections>
Expand Down

0 comments on commit 464d07d

Please sign in to comment.