Skip to content

Commit

Permalink
wip sat morning
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMillz committed Nov 9, 2024
1 parent 9788a2a commit ff94fd2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions apps/web/src/hooks/useNnsOrEnsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ const useNnsOrEnsData = (address: AddressType | string) => {
() => fetchNNSName(address),
{
revalidateOnFocus: false,
dedupingInterval: 60000, // 1-minute cache to mimic staleTime
dedupingInterval: 60000, // 1-minute cache
}
);

// NNS takes precedence over ENS
const selectedName = nnsName ?? ensName;

// Fetch avatar for the selected name
const { data: finalAvatar } = useEnsAvatar({
name: selectedName,
enabled: Boolean(selectedName),
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/modules/auction/components/WinningBidder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useChainStore } from 'src/stores/useChainStore'
import { AuctionDetail } from './AuctionDetail'

export const WinningBidder = ({ owner }: { owner?: string }) => {
const { name, avatar } = useNnsOrEnsData(owner)
const { name, avatar } = useNnsOrEnsData(owner as string)
const chain = useChainStore((x) => x.chain)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AddressType } from 'src/typings'
import { toSeconds } from 'src/utils/helpers'
import { sanitizeStringForJSON } from 'src/utils/sanitize'

import { AdminFormValues } from '../components/AdminForm'
import { AdminFormValues } from 'components/AdminForm'
import { DaoContractAddresses } from '../stores'

type FormValuesTransactionMap = {
Expand Down
10 changes: 3 additions & 7 deletions apps/web/src/utils/ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,17 @@ export async function isValidAddress(

export async function getEnsAddress(
nameOrAddress: string,
provider: PublicClient | undefined = defaultProvider
) {
let resolvedName
try {
resolvedName = await provider?.getEnsAddress({ name: nameOrAddress })
resolvedName = await defaultProvider?.getEnsAddress({ name: nameOrAddress })
} catch (e) {
console.log(e)
}

return resolvedName ?? nameOrAddress
}

export async function getEnsName(
address: Address,
provider: PublicClient | undefined = defaultProvider
) {
return await provider?.getEnsName({ address })
export async function getEnsName(address: Address) {
return await defaultProvider?.getEnsName({ address })
}
3 changes: 2 additions & 1 deletion packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['next', "next/core-web-vitals", 'turbo', 'prettier'],
extends: ['next', 'next/core-web-vitals', 'turbo', 'prettier'],
plugins: ['@typescript-eslint', 'unused-imports'],
parser: '@typescript-eslint/parser',
rules: {
Expand All @@ -8,6 +8,7 @@ module.exports = {
'@next/next/no-img-element': 'off',
'react/no-unescaped-entities': 0,
'unused-imports/no-unused-imports-ts': 2,
'@next/next/no-page-custom-font': 'off',
},
parserOptions: {
babelOptions: {
Expand Down

0 comments on commit ff94fd2

Please sign in to comment.