Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update Ens resolver of fetchDaoDetails
Browse files Browse the repository at this point in the history
sepehr2github committed May 14, 2024
1 parent 112a3b6 commit f3018df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useDaoDetails.tsx
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ import {resolveIpfsCid} from '@aragon/sdk-client-common';
import request, {gql} from 'graphql-request';
import {SubgraphDao, SubgraphPluginListItem} from 'utils/types';
import {ipfsService} from 'services/ipfs/ipfsService';
import {isEnsDomain} from '@aragon/ods-old';

export const QueryDao = gql`
query Dao($address: ID!) {
@@ -101,7 +102,9 @@ async function fetchDaoDetails(

if (!client) return Promise.reject(new Error('client must be defined'));

const address = await provider.resolveName(daoAddressOrEns as string);
const address = isEnsDomain(daoAddressOrEns)
? await provider.resolveName(daoAddressOrEns as string)
: daoAddressOrEns;

// if network is l2 and has ens name, resolve to address
if (isL2NetworkEns) {

0 comments on commit f3018df

Please sign in to comment.