Skip to content

Commit

Permalink
Merge pull request #1009 from ensdomains/dev
Browse files Browse the repository at this point in the history
Add isEmptyAddress (#1007)
  • Loading branch information
makoto authored Dec 2, 2020
2 parents 4519e89 + 2f7becd commit 24db3a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/SingleName/NameDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { IS_MIGRATED } from '../../graphql/queries'

import { formatDate } from '../../utils/dates'
import { EMPTY_ADDRESS } from '../../utils/records'
import { isEmptyAddress } from '../../utils/records'

import NameRegister from './NameRegister'
import SubmitProof from './SubmitProof'
Expand Down Expand Up @@ -605,7 +605,7 @@ function NameDetails({
domain={domain}
refetch={refetch}
refetchIsMigrated={refetchIsMigrated}
readOnly={account === EMPTY_ADDRESS}
readOnly={isEmptyAddress(account)}
/>
)
} else if (
Expand Down Expand Up @@ -717,7 +717,7 @@ function NameDetails({
domain={domain}
refetch={refetch}
refetchIsMigrated={refetchIsMigrated}
readOnly={account === EMPTY_ADDRESS}
readOnly={isEmptyAddress(account)}
/>
)}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/utils/records.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ export function getPlaceholder(recordType, contentType) {
}

export const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000'

export function isEmptyAddress(address) {
return parseInt(address) === 0
}

0 comments on commit 24db3a2

Please sign in to comment.