mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Validate sendToken address when component updates (#9907)
* Validate sendToken address when component updates On a reproduction of trying to get the error message it seems that if an token address is provided in the address form with ETH selected then changing to a token address, the error message won't show. This will validate the sendtoken address on prop change to properly update the warning message. * Update test to include second doesAmountErrorRequireUpdate call when state is updated and component is updated
This commit is contained in:
parent
75de9086de
commit
44448465ed
@ -154,6 +154,7 @@ export default class SendTransactionScreen extends Component {
|
|||||||
|
|
||||||
if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) {
|
if (sendTokenAddress && prevTokenAddress !== sendTokenAddress) {
|
||||||
this.updateSendToken()
|
this.updateSendToken()
|
||||||
|
this.validate(sendTokenAddress)
|
||||||
updateGas = true
|
updateGas = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ describe('Send Component', function () {
|
|||||||
balance: '',
|
balance: '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
assert(utilsMethodStubs.doesAmountErrorRequireUpdate.calledOnce)
|
assert(utilsMethodStubs.doesAmountErrorRequireUpdate.calledTwice)
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
utilsMethodStubs.doesAmountErrorRequireUpdate.getCall(0).args[0],
|
utilsMethodStubs.doesAmountErrorRequireUpdate.getCall(0).args[0],
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user