Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/shared/src/hooks/useFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,14 @@ export default function useFeed<T>(
const plusEntryAsFirstCard = settings?.plusEntry?.flags?.asFirstCard;

if (feedQuery.data) {
const seenPostIds = new Set<string>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against it but just waiting for Ante to check the API part

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we not already have this discussion? 😆

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newItems = feedQuery.data.pages.reduce((acc, { page }, pageIndex) => {
page.edges.forEach(({ node }, index: number) => {
if (seenPostIds.has(node.id)) {
return;
}
seenPostIds.add(node.id);

const adIndex = acc.length;
const adItem = getAd({ index: adIndex });

Expand Down