Skip to content

Commit 7508f5a

Browse files
committed
Fix yesterday rate key lookup
1 parent ff390fa commit 7508f5a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- changed: Credit card allowed countries to add Botswana, Cambodia, Panama, and Sri Lanka
1212
- fixed: Default swap pair logic from the trade modal was not prioritizing mainnet assets
1313
- fixed: "FIO Address does not exist" error after transferring a FIO name
14+
- fixed: Fix incorrect string comparison resulting in wrong rate used for 24 change calculation
1415
- removed: 'fasterpayments' payment type
1516
- removed: Turking bank transfer support
1617

src/hooks/useTokenDisplayData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const useTokenDisplayData = (props: { tokenId: EdgeTokenId; wallet: EdgeC
3131
const assetFiatPrice = useCurrencyFiatRate({ currencyCode, isoFiatCurrencyCode })
3232
const assetFiatYestPrice = useSelector(state => {
3333
// The extra _ at the end means there is yesterday's date string at the end of the key
34-
const pair = Object.keys(state.exchangeRates).find(pair => pair.includes(`${currencyCode}_iso:USD_`))
34+
const pair = Object.keys(state.exchangeRates).find(pair => pair.startsWith(`${currencyCode}_iso:USD_`))
3535
if (pair != null) return state.exchangeRates[pair]
3636
return '0'
3737
})

0 commit comments

Comments
 (0)