Skip to content

Commit

Permalink
Merge pull request #3713 from blockchain/fix/show-fiats-holdings
Browse files Browse the repository at this point in the history
fix(fiat): show in holdings section
  • Loading branch information
schnogz committed Oct 5, 2021
2 parents 67e51ae + be98fc0 commit 79309f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ export const getCoinsSortedByBalance = createDeepEqualSelector(
const transform = (coins: ExtractSuccess<typeof coinsR>) => {
const coinSort = (a?: CoinfigType, b?: CoinfigType) => {
if (!a || !b) return -1
if (window.coins[a.symbol].coinfig.type.name === 'FIAT') return -1
if (window.coins[b.symbol].coinfig.type.name === 'FIAT') return -1
if (window.coins[a.symbol].coinfig.type.name === 'FIAT') return 1
if (window.coins[b.symbol].coinfig.type.name === 'FIAT') return 1

const coinA = a.symbol
const coinB = b.symbol
Expand Down Expand Up @@ -312,7 +312,7 @@ export const getCoinsSortedByBalance = createDeepEqualSelector(
const fiatList = reject(
not,
map((coin) => {
if (coin.coinCode in WalletFiatEnum && coin.method === true) {
if (coin.coinfig.type.name === 'FIAT' && coin.method === true) {
return coin.coinfig
}
}, coins)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { lift, mapObjIndexed, toUpper, values } from 'ramda'

import {
AccountTokensBalancesResponseType,
CoinfigType,
ExtractSuccess,
SBPaymentTypes,
SupportedWalletCurrencyType,
SwapOrderType
} from '@core/types'
import { selectors } from 'data'
Expand Down Expand Up @@ -54,13 +54,14 @@ export const getCoinsWithBalanceOrMethod = (state: RootState) => {
.filter(Boolean)

return values(
mapObjIndexed((coin: SupportedWalletCurrencyType) => {
mapObjIndexed((coin: { coinfig: CoinfigType }) => {
return {
...coin,
method:
coin.coinfig.type.name !== 'FIAT' ||
!!paymentMethods.methods.find(
(method) => method.currency === coin.coinCode && method.type === SBPaymentTypes.FUNDS
(method) =>
method.currency === coin.coinfig.symbol && method.type === SBPaymentTypes.FUNDS
)
}
}, coinOrder)
Expand Down

0 comments on commit 79309f1

Please sign in to comment.