We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6d2ad55 + 0aacfd8 commit 0abd519Copy full SHA for 0abd519
src/services/crypto.ts
@@ -74,10 +74,13 @@ class CryptoService {
74
privKey: chainKeys[chain],
75
walletAddress: WalletStore.getWalletAddressByChain(chain),
76
});
77
- WalletStore.setPrice(
78
- wallet.symbol,
79
- parseFloat(prices[wallet.name.toLowerCase()]?.usd ?? '0'),
80
- );
+ // Don't update the price if none is available from the provider
+ let newPrice = prices[wallet.name.toLowerCase()]?.usd ?? null;
+ if (newPrice !== null) {
+ // The price can be actually 0
81
+ newPrice = parseFloat(newPrice);
82
+ WalletStore.setPrice(wallet.symbol, newPrice);
83
+ }
84
let cryptoWallet = WalletFactory.getWallet(wallet);
85
const balance = await cryptoWallet.getBalance();
86
const unconfirmedBalance = balance.getUnconfirmedBalance();
0 commit comments