mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Fix lint errors.
This commit is contained in:
parent
34ca7290c5
commit
0a91671ff6
@ -40,7 +40,7 @@ function sanitizeDecimal (val) {
|
||||
// sanitizeValue('.200') -> '0.200'
|
||||
// sanitizeValue('a.b.1.c,89.123') -> '0.189123'
|
||||
function sanitizeValue (value) {
|
||||
let [integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value)
|
||||
let [ , integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value)
|
||||
|
||||
integer = sanitizeInteger(integer) || '0'
|
||||
decimal = sanitizeDecimal(decimal)
|
||||
|
@ -40,16 +40,15 @@ function mapDispatchToProps (dispatch) {
|
||||
const {
|
||||
gas: gasLimit,
|
||||
gasPrice,
|
||||
from,
|
||||
to,
|
||||
value: amount
|
||||
value: amount,
|
||||
} = txParams
|
||||
dispatch(actions.editTx(id))
|
||||
dispatch(actions.updateGasLimit(gasLimit)),
|
||||
dispatch(actions.updateGasPrice(gasPrice)),
|
||||
dispatch(actions.updateSendTo(to)),
|
||||
dispatch(actions.updateSendAmount(amount)),
|
||||
dispatch(actions.updateSendErrors({ to: null, amount: null })),
|
||||
dispatch(actions.updateGasLimit(gasLimit))
|
||||
dispatch(actions.updateGasPrice(gasPrice))
|
||||
dispatch(actions.updateSendTo(to))
|
||||
dispatch(actions.updateSendAmount(amount))
|
||||
dispatch(actions.updateSendErrors({ to: null, amount: null }))
|
||||
dispatch(actions.showSendPage())
|
||||
},
|
||||
cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })),
|
||||
@ -176,7 +175,7 @@ ConfirmSendEther.prototype.getData = function () {
|
||||
}
|
||||
|
||||
ConfirmSendEther.prototype.render = function () {
|
||||
const { editTransaction, selectedAddress, currentCurrency, clearSend } = this.props
|
||||
const { editTransaction, currentCurrency, clearSend } = this.props
|
||||
const txMeta = this.gatherTxMeta()
|
||||
const txParams = txMeta.txParams || {}
|
||||
|
||||
@ -441,7 +440,7 @@ ConfirmSendEther.prototype.getFormEl = function () {
|
||||
ConfirmSendEther.prototype.gatherTxMeta = function () {
|
||||
const props = this.props
|
||||
const state = this.state
|
||||
let txData = clone(state.txData) || clone(props.txData)
|
||||
const txData = clone(state.txData) || clone(props.txData)
|
||||
|
||||
if (props.send.editingTransactionId) {
|
||||
const {
|
||||
@ -450,7 +449,7 @@ ConfirmSendEther.prototype.gatherTxMeta = function () {
|
||||
amount: value,
|
||||
gasLimit: gas,
|
||||
gasPrice,
|
||||
}
|
||||
},
|
||||
} = props
|
||||
const { txParams: { from, to } } = txData
|
||||
txData.txParams = {
|
||||
|
@ -150,9 +150,9 @@ function reduceMetamask (state, action) {
|
||||
case actions.SAVE_ACCOUNT_LABEL:
|
||||
const account = action.value.account
|
||||
const name = action.value.label
|
||||
var id = {}
|
||||
const id = {}
|
||||
id[account] = extend(metamaskState.identities[account], { name })
|
||||
var identities = extend(metamaskState.identities, id)
|
||||
const identities = extend(metamaskState.identities, id)
|
||||
return extend(metamaskState, { identities })
|
||||
|
||||
case actions.SET_CURRENT_FIAT:
|
||||
@ -272,10 +272,10 @@ function reduceMetamask (state, action) {
|
||||
})
|
||||
|
||||
case actions.UPDATE_TRANSACTION_PARAMS:
|
||||
const { id, value } = action
|
||||
const { id: txId, value } = action
|
||||
let { selectedAddressTxList } = metamaskState
|
||||
selectedAddressTxList = selectedAddressTxList.map(tx => {
|
||||
if (tx.id === id) {
|
||||
if (tx.id === txId) {
|
||||
tx.txParams = value
|
||||
}
|
||||
return tx
|
||||
|
@ -111,7 +111,7 @@ SendTransactionScreen.prototype.componentWillMount = function () {
|
||||
.all([
|
||||
getGasPrice(),
|
||||
estimateGas(estimateGasParams),
|
||||
tokenContract && tokenContract.balanceOf(from.address)
|
||||
tokenContract && tokenContract.balanceOf(from.address),
|
||||
])
|
||||
.then(([gasPrice, gas, usersToken]) => {
|
||||
|
||||
@ -565,9 +565,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
|
||||
gasPrice,
|
||||
signTokenTx,
|
||||
signTx,
|
||||
updateAndApproveTx,
|
||||
selectedToken,
|
||||
toAccounts,
|
||||
editingTransactionId,
|
||||
errors: { amount: amountError, to: toError },
|
||||
backToConfirmScreen,
|
||||
|
Loading…
Reference in New Issue
Block a user