Fix token validation in Send flow (#10045)

Additional validation was added in #9907 to ensure that the "Known
contract address" warning was shown when sending tokens to another
token address after switching assets on the Send screen. Unfortunately
this change had the unintended side-effect of preventing _all_ token
sends after switching assets, so long as the recipient was not an
internal address.

The problem is that the `validate` function expects to be passed the
address of the token send recipient in the case where a token is
selected. Instead the token address was being passed to the validate
function.

The `query` state is now used, which should always contain the
recipient address. This is the same state used in the only other place
the `validate` function is called.
feature/default_network_editable
Mark Stacey 4 years ago committed by GitHub
parent 86fba2dac1
commit 4350a1422e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ui/app/pages/send/send.component.js

@ -156,7 +156,7 @@ export default class SendTransactionScreen extends Component {
if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) {
this.updateSendToken()
this.validate(sendTokenAddress)
this.validate(this.state.query)
updateGas = true
}

Loading…
Cancel
Save