Skip to content

Commit

Permalink
Refactor DaoHierarchyNode to remove unused chainId and streamline net…
Browse files Browse the repository at this point in the history
…work configuration handling
  • Loading branch information
Da-Colon committed Dec 5, 2024
1 parent dae8741 commit dc95f17
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/DaoHierarchy/DaoHierarchyNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link as RouterLink } from 'react-router-dom';
import { Address, getContract, zeroAddress } from 'viem';
import { useChainId, usePublicClient } from 'wagmi';
import { usePublicClient } from 'wagmi';
import { DAOQueryDocument } from '../../../.graphclient';
import { SENTINEL_ADDRESS } from '../../constants/common';
import { DAO_ROUTES } from '../../constants/routes';
Expand Down Expand Up @@ -43,8 +43,7 @@ export function DaoHierarchyNode({
const safeApi = useSafeAPI();
const [hierarchyNode, setHierarchyNode] = useState<DaoHierarchyInfo>();
const [hasErrorLoading, setErrorLoading] = useState<boolean>(false);
const { addressPrefix, subgraph } = useNetworkConfigStore();
const chainId = useChainId();
const { addressPrefix, subgraph, chain } = useNetworkConfigStore();
const publicClient = usePublicClient();

const { getAddressContractType } = useAddressContractType();
Expand Down Expand Up @@ -168,7 +167,7 @@ export function DaoHierarchyNode({
if (safeAddress) {
const cachedNode = getValue({
cacheName: CacheKeys.HIERARCHY_DAO_INFO,
chainId,
chainId: chain.id,
daoAddress: safeAddress,
});
if (cachedNode) {
Expand All @@ -182,7 +181,7 @@ export function DaoHierarchyNode({
setValue(
{
cacheName: CacheKeys.HIERARCHY_DAO_INFO,
chainId,
chainId: chain.id,
daoAddress: safeAddress,
},
_node,
Expand Down

0 comments on commit dc95f17

Please sign in to comment.