Skip to content

Commit

Permalink
Merge pull request #3485 from blockchain/fix/coin-list
Browse files Browse the repository at this point in the history
fix(coin list): filter out unknown coinfigs
  • Loading branch information
schnogz authored Aug 18, 2021
2 parents 6c29fe8 + ab3d5d1 commit 800bce0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ export const getData = createDeepEqualSelector(
}, coins)
)

// balances
// eslint-disable-next-line
console.log(Object.keys(balances))
// returns all coins with balances as a list
const cryptoList = map(
(coin) => coins.find((c) => c.coinfig.symbol === coin),
(coin) => {
return coins.find((c) => c.coinfig?.symbol === coin)
},
reject(
not,
map((x) => last(x) !== '0' && head(x), toPairs(balances))
Expand All @@ -91,7 +96,9 @@ export const getData = createDeepEqualSelector(
.map((coin) => window.coins[coin].coinfig)

// list of coins with balance and then coins w/ no balance but swaps
return [...coinsWithBalance, ...coinsWithoutBalanceToTrack].sort(coinSort) as CoinfigType[]
return [...coinsWithBalance, ...coinsWithoutBalanceToTrack]
.sort(coinSort)
.filter(Boolean) as CoinfigType[]
}

return lift(transform)(coinsR)
Expand Down

0 comments on commit 800bce0

Please sign in to comment.