File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,13 @@ class CryptoService {
74
74
privKey : chainKeys [ chain ] ,
75
75
walletAddress : WalletStore . getWalletAddressByChain ( chain ) ,
76
76
} ) ;
77
- WalletStore . setPrice (
78
- wallet . symbol ,
79
- parseFloat ( prices [ wallet . name . toLowerCase ( ) ] ?. usd ?? '0' ) ,
80
- ) ;
77
+ // Don't update the price if none is available from the provider
78
+ let newPrice = prices [ wallet . name . toLowerCase ( ) ] ?. usd ?? null ;
79
+ if ( newPrice !== null ) {
80
+ // The price can be actually 0
81
+ newPrice = parseFloat ( newPrice ) ;
82
+ WalletStore . setPrice ( wallet . symbol , newPrice ) ;
83
+ }
81
84
let cryptoWallet = WalletFactory . getWallet ( wallet ) ;
82
85
const balance = await cryptoWallet . getBalance ( ) ;
83
86
const unconfirmedBalance = balance . getUnconfirmedBalance ( ) ;
You can’t perform that action at this time.
0 commit comments