Skip to content

Commit

Permalink
fix: farcaster address filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Jun 12, 2024
1 parent e8d34bd commit 30ed7e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getMinimalProfileFromAddress = async (
identity: address,
},
}),
next: { revalidate: 86400 }, // Cache for 1 day
next: { revalidate: 0 }, // Cache for 1 day
});

// Check if request was successful
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getMinimalProfileInfoByPlatform = async (
: identity,
},
}),
next: { revalidate: 86400 }, // Cache for 1 day
next: { revalidate: 0 }, // Cache for 1 day
});

// Check if request was successful
Expand Down
9 changes: 8 additions & 1 deletion packages/dapp/src/lib/airstack/getProfileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getProfileInfo = async (
query: GetProfileInfoDocument,
variables,
}),
next: { revalidate: 86400 }, // Cache for 1 day
next: { revalidate: 0 }, // Cache for 1 day
});

// Check if request was successful
Expand Down Expand Up @@ -74,6 +74,13 @@ export const getProfileInfo = async (
data.Wallet.addresses = data.Wallet.addresses.filter(
(address) => address !== farcasterSocials[0].userAddress
);

// Check if still more than address remove all except the last one
if (data.Wallet.addresses.length > 1) {
data.Wallet.addresses = [
data.Wallet.addresses[data.Wallet.addresses.length - 1],
];
}
}

return data;
Expand Down

0 comments on commit 30ed7e0

Please sign in to comment.