Skip to content

Commit

Permalink
add date wrap for wrapperData expiryDate
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Feb 16, 2023
1 parent e08e23b commit c006696
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e2e/specs/stateless/12_updateResolver.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { acceptMetamaskAccess } from '../../setup'

const newResolver = '0x70e0bA845a1A0F2DA3359C97E0285013525FFC49'
const newResolver = '0x0E801D84Fa97b50751Dbf25036d067dCf18858bF'
const oldResolver = '0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB'

describe('Update Resolver', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/fuses/useGetFusesSetDates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const mockHistory: any = {
transactionHash: '0x31ec20daa6b92e3aa0d2e4f86178b72240e0e42fe7a0ce7f8371818b71f807d1',
id: '85-5',
data: {
resolver: '0x70e0ba845a1a0f2da3359c97e0285013525ffc49',
resolver: '0x0E801D84Fa97b50751Dbf25036d067dCf18858bF',
},
},
{
Expand Down
12 changes: 11 additions & 1 deletion src/hooks/useBasicName.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useMemo } from 'react'
import { useQuery } from 'wagmi'

import { truncateFormat } from '@ensdomains/ensjs/utils/format'
Expand Down Expand Up @@ -53,7 +54,16 @@ export const useBasicName = (name?: string | null, normalised?: boolean) => {
},
)

const [ownerData, wrapperData, expiryData, priceData] = batchData || []
const [ownerData, _wrapperData, expiryData, priceData] = batchData || []

const wrapperData = useMemo(() => {
if (!_wrapperData) return undefined
const { expiryDate, ...rest } = _wrapperData
return {
...rest,
expiryDate: expiryDate ? new Date(expiryDate) : undefined,
}
}, [_wrapperData])

const registrationStatus = batchData
? getRegistrationStatus({
Expand Down

0 comments on commit c006696

Please sign in to comment.