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 @@ -67,10 +67,13 @@ class CryptoService {
67
67
privKey : chainKeys [ chain ] ,
68
68
walletAddress : WalletStore . getWalletAddressByChain ( chain ) ,
69
69
} ) ;
70
- WalletStore . setPrice (
71
- wallet . symbol ,
72
- parseFloat ( prices [ wallet . name . toLowerCase ( ) ] ?. usd ?? '0' ) ,
73
- ) ;
70
+ // Don't update the price if none is available from the provider
71
+ let newPrice = prices [ wallet . name . toLowerCase ( ) ] ?. usd ?? null ;
72
+ if ( newPrice !== null ) {
73
+ // The price can be actually 0
74
+ newPrice = parseFloat ( newPrice ) ;
75
+ WalletStore . setPrice ( wallet . symbol , newPrice ) ;
76
+ }
74
77
let cryptoWallet = WalletFactory . getWallet ( wallet ) ;
75
78
const balance = await cryptoWallet . getBalance ( ) ;
76
79
const unconfirmedBalance = balance . getUnconfirmedBalance ( ) ;
You can’t perform that action at this time.
0 commit comments