File tree Expand file tree Collapse file tree
src/components/relay-dashboard/totalEarning Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ export const TotalEarning: React.FC = () => {
2828 } ;
2929 } , [ bitcoinRates ] ) ;
3030
31- const latestRate = bitcoinRates . length > 0 ? bitcoinRates [ bitcoinRates . length - 1 ] ?. usd_value : undefined ;
32- const previousRate = bitcoinRates . length > 1 ? bitcoinRates [ bitcoinRates . length - 2 ] ?. usd_value : undefined ;
31+ const latestRate = bitcoinRates . length > 0 ? Number ( bitcoinRates [ bitcoinRates . length - 1 ] ?. usd_value ) : undefined ;
32+ const previousRate = bitcoinRates . length > 1 ? Number ( bitcoinRates [ bitcoinRates . length - 2 ] ?. usd_value ) : undefined ;
3333 const isIncreased = latestRate && previousRate ? latestRate > previousRate : false ;
3434 const rateDifference = latestRate && previousRate ? ( ( latestRate - previousRate ) / previousRate ) * 100 : 0 ;
3535
@@ -48,7 +48,7 @@ export const TotalEarning: React.FC = () => {
4848 ) ;
4949 }
5050
51- const formattedLatestRate = latestRate !== undefined ? parseFloat ( latestRate . toFixed ( 0 ) ) : 0 ;
51+ const formattedLatestRate = latestRate !== undefined && ! isNaN ( latestRate ) ? Math . round ( latestRate ) : 0 ;
5252 return (
5353 < NFTCard isSider >
5454 < BaseRow gutter = { [ 14 , 14 ] } >
You can’t perform that action at this time.
0 commit comments