Skip to content

Commit

Permalink
refactor: duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
pbkompasz committed Oct 26, 2024
1 parent 3157f28 commit 8066671
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/nextjs/app/builders/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const Builders: NextPage = () => {

// Filter out duplicate addresses
const filteredAddresses: string[] = [];
events
.map(event => event.args.builder as string)
.forEach(address => {
if (!filteredAddresses.find(addr => address === addr)) filteredAddresses.push(address);
});
events.forEach(event => {
const address = event.args.builder;
if (!address) return;
if (!filteredAddresses.find(addr => address === addr)) filteredAddresses.push(address);
});

const builders = await Promise.all(
filteredAddresses.map(async address => {
Expand Down

0 comments on commit 8066671

Please sign in to comment.