From 5cfb28b30a38bbbfcbbbe01c0d53c03de95299f1 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 7 Sep 2018 17:27:15 -0400 Subject: [PATCH] only create one transaction when other field is unchanged --- app/components/ens/registerSubDomain.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/ens/registerSubDomain.js b/app/components/ens/registerSubDomain.js index ca2acfa..59c98da 100644 --- a/app/components/ens/registerSubDomain.js +++ b/app/components/ens/registerSubDomain.js @@ -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()) );