diff options
author | Dan <danjm.com@gmail.com> | 2017-10-06 23:21:02 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-09 08:49:52 +0800 |
commit | db1258f3de88f14cd54e2b4fd1cecc62cf6361e5 (patch) | |
tree | 2ec138204631eaae2ac6ce6c9986a751070ae02a /ui/app/send.js | |
parent | 49f76d27a9967cbeff0ba5b3d41277c558999472 (diff) | |
download | tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar.gz tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar.bz2 tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar.lz tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar.xz tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.tar.zst tangerine-wallet-browser-db1258f3de88f14cd54e2b4fd1cecc62cf6361e5.zip |
Conversion util can invert conversion rate
Diffstat (limited to 'ui/app/send.js')
-rw-r--r-- | ui/app/send.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index 2e6409f32..5643d927b 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -22,7 +22,6 @@ const { const { stripHexPrefix, addHexPrefix } = require('ethereumjs-util') const { isHex, numericBalance, isValidAddress, allNull } = require('./util') const { conversionUtil, conversionGreaterThan } = require('./conversion-util') -const BigNumber = require('bignumber.js') module.exports = connect(mapStateToProps)(SendTransactionScreen) @@ -470,18 +469,14 @@ SendTransactionScreen.prototype.getAmountToSend = function (amount) { const { activeCurrency } = this.state const { conversionRate } = this.props - // TODO: need a clean way to integrate this into conversionUtil - const sendConversionRate = activeCurrency === 'ETH' - ? conversionRate - : new BigNumber(1.0).div(conversionRate) - return conversionUtil(amount, { fromNumericBase: 'dec', toNumericBase: 'hex', fromCurrency: activeCurrency, toCurrency: 'ETH', toDenomination: 'WEI', - conversionRate: sendConversionRate, + conversionRate, + invertConversionRate: activeCurrency !== 'ETH', }) } |