mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-18 21:35:21 +01:00
Update BlueComponents.js
This commit is contained in:
parent
61563bf8d6
commit
9e02617d12
@ -2290,19 +2290,19 @@ export class BlueBitcoinAmount extends Component {
|
||||
secondaryDisplayCurrency = formatBalanceWithoutSuffix(sat, BitcoinUnit.LOCAL_CURRENCY, false);
|
||||
break;
|
||||
case BitcoinUnit.SATS:
|
||||
secondaryDisplayCurrency = formatBalanceWithoutSuffix(amount.toString(), BitcoinUnit.LOCAL_CURRENCY, false);
|
||||
secondaryDisplayCurrency = formatBalanceWithoutSuffix((isNaN(amount) ? 0 : amount).toString(), BitcoinUnit.LOCAL_CURRENCY, false);
|
||||
break;
|
||||
case BitcoinUnit.LOCAL_CURRENCY:
|
||||
secondaryDisplayCurrency = currency.fiatToBTC(parseFloat(amount));
|
||||
if (BlueBitcoinAmount.conversionCache[amount + BitcoinUnit.LOCAL_CURRENCY]) {
|
||||
// cache hit! we reuse old value that supposedly doesnt have rounding errors
|
||||
const sats = BlueBitcoinAmount.conversionCache[amount + BitcoinUnit.LOCAL_CURRENCY];
|
||||
secondaryDisplayCurrency = currency.fiatToBTC(parseFloat(isNaN(amount) ? 0 : amount));
|
||||
if (BlueBitcoinAmount.conversionCache[isNaN(amount) ? 0 : amount + BitcoinUnit.LOCAL_CURRENCY]) {
|
||||
// cache hit! we reuse old value that supposedly doesn't have rounding errors
|
||||
const sats = BlueBitcoinAmount.conversionCache[isNaN(amount) ? 0 : amount + BitcoinUnit.LOCAL_CURRENCY];
|
||||
secondaryDisplayCurrency = currency.satoshiToBTC(sats);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (amount === BitcoinUnit.MAX) secondaryDisplayCurrency = ''; // we dont want to display NaN
|
||||
if (amount === BitcoinUnit.MAX) secondaryDisplayCurrency = ''; // we don't want to display NaN
|
||||
return (
|
||||
<TouchableWithoutFeedback disabled={this.props.pointerEvents === 'none'} onPress={() => this.textInput.focus()}>
|
||||
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
||||
|
Loading…
Reference in New Issue
Block a user