We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d31f30f commit 0aacfd8Copy full SHA for 0aacfd8
src/services/crypto.ts
@@ -67,10 +67,13 @@ class CryptoService {
67
privKey: chainKeys[chain],
68
walletAddress: WalletStore.getWalletAddressByChain(chain),
69
});
70
- WalletStore.setPrice(
71
- wallet.symbol,
72
- parseFloat(prices[wallet.name.toLowerCase()]?.usd ?? '0'),
73
- );
+ // 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
74
+ newPrice = parseFloat(newPrice);
75
+ WalletStore.setPrice(wallet.symbol, newPrice);
76
+ }
77
let cryptoWallet = WalletFactory.getWallet(wallet);
78
const balance = await cryptoWallet.getBalance();
79
const unconfirmedBalance = balance.getUnconfirmedBalance();
0 commit comments