convert promise to async await
This commit is contained in:
parent
6553a44e45
commit
ba0d641868
|
@ -60,11 +60,11 @@ const AddDomain = withFormik({
|
|||
if (!domainName) errors.domainName = 'Required';
|
||||
return errors;
|
||||
},
|
||||
handleSubmit(values, { setSubmitting }) {
|
||||
async handleSubmit(values, { setSubmitting }) {
|
||||
const { domainName, domainPrice } = values
|
||||
const { methods: { domains, addDomain, setDomainPrice } } = ENSSubdomainRegistry
|
||||
const hashedDomain = hash(domainName);
|
||||
getDomain(hashedDomain, domains).then(({ state }) => {
|
||||
const { state } = await getDomain(hashedDomain, domains);
|
||||
setPrice(
|
||||
!!state ? setDomainPrice : addDomain,
|
||||
hashedDomain,
|
||||
|
@ -78,7 +78,6 @@ const AddDomain = withFormik({
|
|||
setSubmitting(false);
|
||||
console.log(err);
|
||||
})
|
||||
})
|
||||
}
|
||||
})(InnerForm)
|
||||
|
||||
|
|
Loading…
Reference in New Issue