mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-27 10:48:22 +00:00
call validateAddress only once per inputChange()
This commit is contained in:
parent
8316661011
commit
d9e03c898a
@ -141,13 +141,17 @@ const inputChange = (inputName: string, value: string): ThunkAction => (
|
|||||||
type: SIGN_VERIFY.TOUCH,
|
type: SIGN_VERIFY.TOUCH,
|
||||||
inputName,
|
inputName,
|
||||||
});
|
});
|
||||||
if (inputName === 'verifyAddress' && validateAddress(value) !== null) {
|
|
||||||
|
if (inputName === 'verifyAddress') {
|
||||||
|
const error = validateAddress(value);
|
||||||
|
if (error) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: SIGN_VERIFY.ERROR,
|
type: SIGN_VERIFY.ERROR,
|
||||||
inputName,
|
inputName,
|
||||||
message: validateAddress(value),
|
message: error,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearSign = (): ThunkAction => (dispatch: Dispatch): void => {
|
const clearSign = (): ThunkAction => (dispatch: Dispatch): void => {
|
||||||
|
Loading…
Reference in New Issue
Block a user