Skip to content

Commit

Permalink
Merge pull request #143 from dappforce/fix-domain
Browse files Browse the repository at this point in the history
Disable register button if user is not logged in
  • Loading branch information
olehmell authored Oct 5, 2023
2 parents 2762e24 + b3decd3 commit 66c626a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Modal, Skeleton, Space, Tag } from 'antd'
import clsx from 'clsx'
import { useEffect, useState } from 'react'
import { useIsMyAddress } from 'src/components/auth/MyAccountsContext'
import { useIsMyAddress, useMyAddress } from 'src/components/auth/MyAccountsContext'
import { SelectAccountInput } from 'src/components/common/inputs/SelectAccountInput'
import { useBalancesByNetwork } from 'src/components/donate/AmountInput'
import { useGetDecimalAndSymbol } from 'src/components/utils/useGetDecimalsAndSymbol'
Expand Down Expand Up @@ -177,6 +177,7 @@ const RegisterDomainButton = ({
loadingPrice,
}: BuyByDotButtonProps) => {
const sellerConfig = useSelectSellerConfig()
const myAddress = useMyAddress()
const { sellerChain } = sellerConfig || {}
const { processingDomains } = useManageDomainContext()
const price = useGetPrice(domainSellerKind, domainPrice)
Expand All @@ -190,7 +191,8 @@ const RegisterDomainButton = ({

const chainProps = isSub ? {} : { decimals: decimal, currency: symbol }

const disableRegisterButton = processingDomains[domainName] || loadingPrice || price === '0'
const disableRegisterButton =
processingDomains[domainName] || loadingPrice || price === '0' || !myAddress

const priceValue = withPrice && (
<div>{price ? <FormatBalance value={price} {...chainProps} /> : <>-</>}</div>
Expand Down

0 comments on commit 66c626a

Please sign in to comment.