Skip to content

Commit

Permalink
Fix fetching of new domain
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Oct 10, 2023
1 parent 78961cf commit b319a1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ const RegisterDomainButton = ({
const sellerConfig = useSelectSellerConfig()
const myAddress = useMyAddress()
const { sellerChain } = sellerConfig || {}
const { processingDomains, setDomainToFetch, domainToFetch } = useManageDomainContext()
const { processingDomains, setDomainToFetch } = useManageDomainContext()
const price = useGetPrice(domainSellerKind, domainPrice)
const pendingOrder = useSelectPendingOrderById(domainName)

const { purchaseTxStarted, purchaseInterrupted } = pendingOrder || {}

useEffect(() => {
if (purchaseTxStarted && !domainToFetch && !purchaseInterrupted) {
if (purchaseTxStarted && !purchaseInterrupted) {
setDomainToFetch(domainName)
}
}, [purchaseTxStarted, domainToFetch])
}, [purchaseTxStarted])

const [open, setOpen] = useState(false)
const { decimal, symbol } = useGetDecimalAndSymbol(sellerChain)
Expand Down
2 changes: 1 addition & 1 deletion src/components/domains/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ export const useFetchNewDomains = () => {
}

setDomainToFetch(undefined)
upsertDomains({ domain: domainEntity, address: myAddress, domainName: domainToFetch })
removePendingOrder({ domainName: domainToFetch })
setProcessingDomains({ [domainToFetch]: false })
upsertDomains({ domain: domainEntity, address: myAddress, domainName: domainToFetch })
waitMessage.close()
openManageModal('success', domainToFetch)
}
Expand Down

0 comments on commit b319a1a

Please sign in to comment.