aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-05-17 07:20:58 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-05-17 07:20:58 +0800
commitd8130f1effc31a866476e10153bd854709ae23be (patch)
tree0e4a2df51df090088d238f975c037254bf47d21b /ui/app/components
parent53b8d18a5f649c73a58a96e36a9458903d8af6aa (diff)
downloadtangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar.gz
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar.bz2
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar.lz
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar.xz
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.tar.zst
tangerine-wallet-browser-d8130f1effc31a866476e10153bd854709ae23be.zip
Fix reset button.
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/bn-as-decimal-input.js6
-rw-r--r--ui/app/components/pending-tx.js12
2 files changed, 10 insertions, 8 deletions
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js
index 6c2132ca1..d0eebe09e 100644
--- a/ui/app/components/bn-as-decimal-input.js
+++ b/ui/app/components/bn-as-decimal-input.js
@@ -16,10 +16,10 @@ function BnAsDecimalInput () {
/* Bn as Decimal Input
*
* A component for allowing easy, decimal editing
- * of a passed in hex string value.
+ * of a passed in bn string value.
*
* On change, calls back its `onChange` function parameter
- * and passes it an updated hex string.
+ * and passes it an updated bn string.
*/
BnAsDecimalInput.prototype.render = function () {
@@ -30,8 +30,8 @@ BnAsDecimalInput.prototype.render = function () {
const suffix = props.suffix
const style = props.style
- const newValue = value.toNumber(10) / scale
const scale = Math.pow(10, precision)
+ const newValue = value.toNumber(10) / scale
return (
h('.flex-column', [
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 95d345a3d..5c8d81d07 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -180,7 +180,7 @@ PendingTx.prototype.render = function () {
log.info(`Gas limit changed to ${newBN.toString(10)}`)
const txMeta = this.gatherTxMeta()
txMeta.txParams.gas = '0x' + newBN.toString('hex')
- this.setState({ txData: txMeta })
+ this.setState({ txData: cloneObj(txMeta) })
},
ref: (hexInput) => { this.inputs.push(hexInput) },
}),
@@ -206,7 +206,7 @@ PendingTx.prototype.render = function () {
log.info(`Gas price changed to: ${newBN.toString(10)}`)
const txMeta = this.gatherTxMeta()
txMeta.txParams.gasPrice = '0x' + newBN.toString('hex')
- this.setState({ txData: txMeta })
+ this.setState({ txData: cloneObj(txMeta) })
},
ref: (hexInput) => { this.inputs.push(hexInput) },
}),
@@ -388,7 +388,7 @@ PendingTx.prototype.gatherTxMeta = function () {
log.debug(`pending-tx gatherTxMeta`)
const props = this.props
const state = this.state
- const txData = state.txData || props.txData
+ const txData = cloneObj(state.txData) || cloneObj(props.txData)
log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`)
return txData
@@ -409,7 +409,6 @@ PendingTx.prototype._notZeroOrEmptyString = function (obj) {
function forwardCarrat () {
return (
-
h('img', {
src: 'images/forward-carrat.svg',
style: {
@@ -417,6 +416,9 @@ function forwardCarrat () {
height: '37px',
},
})
-
)
}
+
+function cloneObj (obj) {
+ return JSON.parse(JSON.stringify(obj))
+}