Skip to content

Commit c7c02f9

Browse files
update canbewrapped
1 parent ee2ef54 commit c7c02f9

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

src/hooks/useBasicName.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@ export const useBasicName = ({
110110

111111
const nameWrapperAddress = useContractAddress({ contract: 'ensNameWrapper' })
112112
const isWrapped = !!wrapperData
113-
const canBeWrapped = useMemo(
114-
() =>
115-
!!(
116-
nameWrapperAddress &&
117-
!isWrapped &&
118-
normalisedName?.endsWith('.eth') &&
119-
!isLabelTooLong(normalisedName)
120-
),
121-
[nameWrapperAddress, isWrapped, normalisedName],
122-
)
123113

124114
const registrationStatusTimestamp = useMemo(() => {
125115
if (!isTempPremiumDesynced) return Date.now()
@@ -142,6 +132,19 @@ export const useBasicName = ({
142132
})
143133
: undefined
144134

135+
const canBeWrapped = useMemo(
136+
() =>
137+
!!(
138+
nameWrapperAddress &&
139+
!isWrapped &&
140+
normalisedName?.endsWith('.eth') &&
141+
!isLabelTooLong(normalisedName) &&
142+
!!registrationStatus &&
143+
['registered', 'imported', 'owned'].includes(registrationStatus)
144+
),
145+
[nameWrapperAddress, isWrapped, normalisedName, registrationStatus],
146+
)
147+
145148
const { data: subgraphRegistrant } = useSubgraphRegistrant({
146149
name: normalisedName,
147150
enabled:

0 commit comments

Comments
 (0)