Skip to content

Commit

Permalink
Fix duplicate events on events page
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusti Fernandez authored and ArmandoGraterol committed Jan 27, 2022
1 parent 6502747 commit 9035982
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ColonyEvents = ({

const [eventsSort, setEventsSort] = useState<string>(SortOptions.NEWEST);
const [dataPage, setDataPage] = useState<number>(1);
const [streamedEvents, setstreamedEvents] = useState<
const [streamedEvents, setStreamedEvents] = useState<
SubgraphEventsSubscription['events']
>([]);

Expand All @@ -65,9 +65,8 @@ const ColonyEvents = ({
sortDirection: 'desc',
},
onSubscriptionData: ({ subscriptionData: { data: newSubscriptionData } }) =>
setstreamedEvents([
...streamedEvents,
...(newSubscriptionData?.events || []),
setStreamedEvents([
...new Set([...streamedEvents, ...(newSubscriptionData?.events || [])]),
]),
});

Expand Down

0 comments on commit 9035982

Please sign in to comment.