From c30a42ab8e53ccd90f31b8cc4d195f81674c3fbb Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 10 Dec 2020 14:28:19 -0330 Subject: [PATCH] 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. --- ui/app/pages/send/send.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/pages/send/send.component.js b/ui/app/pages/send/send.component.js index 4171f0611..31540e312 100644 --- a/ui/app/pages/send/send.component.js +++ b/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 }