only create one transaction when other field is unchanged

This commit is contained in:
Barry Gitarts 2018-09-07 17:27:15 -04:00 committed by Barry G
parent 3f3586e746
commit 5cfb28b30a
1 changed files with 4 additions and 2 deletions

View File

@ -162,8 +162,10 @@ const RegisterSubDomain = withFormik({
points ? points.x : zeroBytes32,
points ? points.y : zeroBytes32,
];
if (editAccount) funcsToSend.push(setAddr(node, resolveToAddr), setPubkey(node, args[3], args[4]));
else {
if (editAccount) {
if (address !== web3.eth.defaultAccount) funcsToSend.push(setAddr(node, resolveToAddr));
if (statusAddress && statusAddress !== props.statusContactCode) funcsToSend.push(setPubkey(node, args[3], args[4]));
} else {
funcsToSend.push(
approveAndCall(UsernameRegistrar.address, Number(domainPrice), register(...args).encodeABI())
);