Skip to content

Commit

Permalink
Improve syntax of the filter method. Booleans are the expected return…
Browse files Browse the repository at this point in the history
… type, but it was relying in implicit conversions from `(type1 || type2) / undefined` into `true / false`.
  • Loading branch information
marcelosalloum committed Aug 26, 2024
1 parent 5b50617 commit 5cadeec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/DisbursementDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ export const DisbursementDetails: React.FC<DisbursementDetailsProps> = ({
{walletAssets
?.filter((wa: ApiAsset) => {
// Check for the default native asset
if (wa.code == "XLM") {
return wa;
if (wa.code == "XLM" && wa.issuer == "") {
return true;
}
// Check that the asset is non-native asset that has a distribution account balance
return allBalances?.find(
// Check that the asset is a non-native asset that has a distribution account balance
return !!allBalances?.find(
(balance) =>
balance.assetCode === wa.code &&
balance.assetIssuer === wa.issuer,
Expand Down

0 comments on commit 5cadeec

Please sign in to comment.