1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix lint errors.

This commit is contained in:
Dan 2017-11-08 15:48:27 -03:30 committed by Chi Kei Chan
parent 34ca7290c5
commit 0a91671ff6
4 changed files with 15 additions and 18 deletions

View File

@ -40,7 +40,7 @@ function sanitizeDecimal (val) {
// sanitizeValue('.200') -> '0.200' // sanitizeValue('.200') -> '0.200'
// sanitizeValue('a.b.1.c,89.123') -> '0.189123' // sanitizeValue('a.b.1.c,89.123') -> '0.189123'
function sanitizeValue (value) { function sanitizeValue (value) {
let [integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value) let [ , integer, point, decimal] = (/([^.]*)([.]?)([^.]*)/).exec(value)
integer = sanitizeInteger(integer) || '0' integer = sanitizeInteger(integer) || '0'
decimal = sanitizeDecimal(decimal) decimal = sanitizeDecimal(decimal)

View File

@ -40,16 +40,15 @@ function mapDispatchToProps (dispatch) {
const { const {
gas: gasLimit, gas: gasLimit,
gasPrice, gasPrice,
from,
to, to,
value: amount value: amount,
} = txParams } = txParams
dispatch(actions.editTx(id)) dispatch(actions.editTx(id))
dispatch(actions.updateGasLimit(gasLimit)), dispatch(actions.updateGasLimit(gasLimit))
dispatch(actions.updateGasPrice(gasPrice)), dispatch(actions.updateGasPrice(gasPrice))
dispatch(actions.updateSendTo(to)), dispatch(actions.updateSendTo(to))
dispatch(actions.updateSendAmount(amount)), dispatch(actions.updateSendAmount(amount))
dispatch(actions.updateSendErrors({ to: null, amount: null })), dispatch(actions.updateSendErrors({ to: null, amount: null }))
dispatch(actions.showSendPage()) dispatch(actions.showSendPage())
}, },
cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })), cancelTransaction: ({ id }) => dispatch(actions.cancelTx({ id })),
@ -176,7 +175,7 @@ ConfirmSendEther.prototype.getData = function () {
} }
ConfirmSendEther.prototype.render = function () { ConfirmSendEther.prototype.render = function () {
const { editTransaction, selectedAddress, currentCurrency, clearSend } = this.props const { editTransaction, currentCurrency, clearSend } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
const txParams = txMeta.txParams || {} const txParams = txMeta.txParams || {}
@ -441,7 +440,7 @@ ConfirmSendEther.prototype.getFormEl = function () {
ConfirmSendEther.prototype.gatherTxMeta = function () { ConfirmSendEther.prototype.gatherTxMeta = function () {
const props = this.props const props = this.props
const state = this.state const state = this.state
let txData = clone(state.txData) || clone(props.txData) const txData = clone(state.txData) || clone(props.txData)
if (props.send.editingTransactionId) { if (props.send.editingTransactionId) {
const { const {
@ -450,7 +449,7 @@ ConfirmSendEther.prototype.gatherTxMeta = function () {
amount: value, amount: value,
gasLimit: gas, gasLimit: gas,
gasPrice, gasPrice,
} },
} = props } = props
const { txParams: { from, to } } = txData const { txParams: { from, to } } = txData
txData.txParams = { txData.txParams = {

View File

@ -150,9 +150,9 @@ function reduceMetamask (state, action) {
case actions.SAVE_ACCOUNT_LABEL: case actions.SAVE_ACCOUNT_LABEL:
const account = action.value.account const account = action.value.account
const name = action.value.label const name = action.value.label
var id = {} const id = {}
id[account] = extend(metamaskState.identities[account], { name }) id[account] = extend(metamaskState.identities[account], { name })
var identities = extend(metamaskState.identities, id) const identities = extend(metamaskState.identities, id)
return extend(metamaskState, { identities }) return extend(metamaskState, { identities })
case actions.SET_CURRENT_FIAT: case actions.SET_CURRENT_FIAT:
@ -272,10 +272,10 @@ function reduceMetamask (state, action) {
}) })
case actions.UPDATE_TRANSACTION_PARAMS: case actions.UPDATE_TRANSACTION_PARAMS:
const { id, value } = action const { id: txId, value } = action
let { selectedAddressTxList } = metamaskState let { selectedAddressTxList } = metamaskState
selectedAddressTxList = selectedAddressTxList.map(tx => { selectedAddressTxList = selectedAddressTxList.map(tx => {
if (tx.id === id) { if (tx.id === txId) {
tx.txParams = value tx.txParams = value
} }
return tx return tx

View File

@ -111,7 +111,7 @@ SendTransactionScreen.prototype.componentWillMount = function () {
.all([ .all([
getGasPrice(), getGasPrice(),
estimateGas(estimateGasParams), estimateGas(estimateGasParams),
tokenContract && tokenContract.balanceOf(from.address) tokenContract && tokenContract.balanceOf(from.address),
]) ])
.then(([gasPrice, gas, usersToken]) => { .then(([gasPrice, gas, usersToken]) => {
@ -565,9 +565,7 @@ SendTransactionScreen.prototype.onSubmit = function (event) {
gasPrice, gasPrice,
signTokenTx, signTokenTx,
signTx, signTx,
updateAndApproveTx,
selectedToken, selectedToken,
toAccounts,
editingTransactionId, editingTransactionId,
errors: { amount: amountError, to: toError }, errors: { amount: amountError, to: toError },
backToConfirmScreen, backToConfirmScreen,