Browse Source

fix(convert): return value if converting with same to and from currency

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
498b09ca35
  1. 6
      app/utils/btc.js

6
app/utils/btc.js

@ -93,6 +93,8 @@ export function convert(from, to, amount, price) {
return btcToSatoshis(amount) return btcToSatoshis(amount)
case 'usd': case 'usd':
return btcToUsd(amount, price) return btcToUsd(amount, price)
case 'btc':
return amount
} }
break break
case 'bits': case 'bits':
@ -103,6 +105,8 @@ export function convert(from, to, amount, price) {
return bitsToSatoshis(amount) return bitsToSatoshis(amount)
case 'usd': case 'usd':
return bitsToUsd(amount, price) return bitsToUsd(amount, price)
case 'bits':
return amount
} }
break break
case 'sats': case 'sats':
@ -113,6 +117,8 @@ export function convert(from, to, amount, price) {
return satoshisToBits(amount) return satoshisToBits(amount)
case 'usd': case 'usd':
return satoshisToUsd(amount, price) return satoshisToUsd(amount, price)
case 'sats':
return amount
} }
break break
default: default:

Loading…
Cancel
Save