mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix reset button.
This commit is contained in:
parent
53b8d18a5f
commit
d8130f1eff
@ -16,10 +16,10 @@ function BnAsDecimalInput () {
|
|||||||
/* Bn as Decimal Input
|
/* Bn as Decimal Input
|
||||||
*
|
*
|
||||||
* A component for allowing easy, decimal editing
|
* 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
|
* 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 () {
|
BnAsDecimalInput.prototype.render = function () {
|
||||||
@ -30,8 +30,8 @@ BnAsDecimalInput.prototype.render = function () {
|
|||||||
|
|
||||||
const suffix = props.suffix
|
const suffix = props.suffix
|
||||||
const style = props.style
|
const style = props.style
|
||||||
const newValue = value.toNumber(10) / scale
|
|
||||||
const scale = Math.pow(10, precision)
|
const scale = Math.pow(10, precision)
|
||||||
|
const newValue = value.toNumber(10) / scale
|
||||||
|
|
||||||
return (
|
return (
|
||||||
h('.flex-column', [
|
h('.flex-column', [
|
||||||
|
@ -180,7 +180,7 @@ PendingTx.prototype.render = function () {
|
|||||||
log.info(`Gas limit changed to ${newBN.toString(10)}`)
|
log.info(`Gas limit changed to ${newBN.toString(10)}`)
|
||||||
const txMeta = this.gatherTxMeta()
|
const txMeta = this.gatherTxMeta()
|
||||||
txMeta.txParams.gas = '0x' + newBN.toString('hex')
|
txMeta.txParams.gas = '0x' + newBN.toString('hex')
|
||||||
this.setState({ txData: txMeta })
|
this.setState({ txData: cloneObj(txMeta) })
|
||||||
},
|
},
|
||||||
ref: (hexInput) => { this.inputs.push(hexInput) },
|
ref: (hexInput) => { this.inputs.push(hexInput) },
|
||||||
}),
|
}),
|
||||||
@ -206,7 +206,7 @@ PendingTx.prototype.render = function () {
|
|||||||
log.info(`Gas price changed to: ${newBN.toString(10)}`)
|
log.info(`Gas price changed to: ${newBN.toString(10)}`)
|
||||||
const txMeta = this.gatherTxMeta()
|
const txMeta = this.gatherTxMeta()
|
||||||
txMeta.txParams.gasPrice = '0x' + newBN.toString('hex')
|
txMeta.txParams.gasPrice = '0x' + newBN.toString('hex')
|
||||||
this.setState({ txData: txMeta })
|
this.setState({ txData: cloneObj(txMeta) })
|
||||||
},
|
},
|
||||||
ref: (hexInput) => { this.inputs.push(hexInput) },
|
ref: (hexInput) => { this.inputs.push(hexInput) },
|
||||||
}),
|
}),
|
||||||
@ -388,7 +388,7 @@ PendingTx.prototype.gatherTxMeta = function () {
|
|||||||
log.debug(`pending-tx gatherTxMeta`)
|
log.debug(`pending-tx gatherTxMeta`)
|
||||||
const props = this.props
|
const props = this.props
|
||||||
const state = this.state
|
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)}`)
|
log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`)
|
||||||
return txData
|
return txData
|
||||||
@ -409,7 +409,6 @@ PendingTx.prototype._notZeroOrEmptyString = function (obj) {
|
|||||||
|
|
||||||
function forwardCarrat () {
|
function forwardCarrat () {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
h('img', {
|
h('img', {
|
||||||
src: 'images/forward-carrat.svg',
|
src: 'images/forward-carrat.svg',
|
||||||
style: {
|
style: {
|
||||||
@ -417,6 +416,9 @@ function forwardCarrat () {
|
|||||||
height: '37px',
|
height: '37px',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cloneObj (obj) {
|
||||||
|
return JSON.parse(JSON.stringify(obj))
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user