Skip to content

Commit

Permalink
Filter to uniques in fills, this handles spurious dupes from fill feed (
Browse files Browse the repository at this point in the history
  • Loading branch information
brittcyr authored Nov 8, 2024
1 parent 10967f5 commit ddb5322
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion debug-ui/app/components/Fills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ const Fills = ({ marketAddress }: { marketAddress: string }): ReactElement => {
dateString: await slotToTimestamp(fill.slot),
};

setFills((prevFills) => [fillUi, ...prevFills]);
setFills((prevFills) =>
[fillUi, ...prevFills].filter((value, index, self) => {
return self.indexOf(value) === index;
}),
);
};

ws.onclose = (message): void => {
Expand Down

0 comments on commit ddb5322

Please sign in to comment.