update methods to work with embark 3.2 and React 16.4

This commit is contained in:
Barry Gitarts 2018-09-28 15:29:42 -04:00 committed by Barry G
parent 513058bbff
commit 3d66a72d4c
2 changed files with 3 additions and 2 deletions

View File

@ -158,7 +158,7 @@ const InnerForm = ({
{/*</Field>*/} {/*</Field>*/}
<div style={{ position: 'relative', left: 0, right: 0, bottom: 0 }}> <div style={{ position: 'relative', left: 0, right: 0, bottom: 0 }}>
{!isSubmitting ? <MobileButton onClick={() => { setStatus('terms') }} text={`${editAccount ? 'Save' : 'Register'} with transaction`} style={{ width: '100%' }} /> : <CircularProgress style={{ marginLeft: '45%' }} />} {!isSubmitting ? <MobileButton onClick={() => { setStatus('terms') }} text={`${editAccount ? 'Save' : 'Register'} with transaction`} style={{ width: '100%' }} /> : <CircularProgress style={{ marginLeft: '45%' }} />}
<Terms open={displayTerms(status)} onSubmit={() => { setStatus(null); formRef.dispatchEvent(new Event('submit')) }} /> <Terms open={displayTerms(status)} onSubmit={() => { setStatus(null); formRef.current.dispatchEvent(new Event('submit')) }} form={formRef} />
</div> </div>
</Hidden> </Hidden>
</div> </div>

View File

@ -1,4 +1,5 @@
import EmbarkJS from 'Embark/EmbarkJS'; import EmbarkJS from 'Embark/EmbarkJS';
import web3 from "Embark/web3";
import ENSRegistry from 'Embark/contracts/ENSRegistry'; import ENSRegistry from 'Embark/contracts/ENSRegistry';
import PublicResolver from 'Embark/contracts/PublicResolver'; import PublicResolver from 'Embark/contracts/PublicResolver';
@ -8,6 +9,6 @@ export const nullAddress = '0x0000000000000000000000000000000000000000';
export const getResolver = async node => { export const getResolver = async node => {
const resolverAddress = await resolver(node).call(); const resolverAddress = await resolver(node).call();
return resolverAddress !== nullAddress return resolverAddress !== nullAddress
? new EmbarkJS.Blockchain.Contract({ abi: PublicResolver._jsonInterface, address: resolverAddress }) ? new EmbarkJS.Blockchain.Contract({ abi: PublicResolver._jsonInterface, address: resolverAddress, web3 })
: PublicResolver : PublicResolver
} }