Skip to content

Commit

Permalink
refactor useHatsTree to replace 'props' with 'params' for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Dec 18, 2024
1 parent 2ac122d commit f226c83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/hooks/DAO/loaders/useHatsTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const useHatsTree = () => {
const apolloClient = useApolloClient();

const getHatsTree = useCallback(
async (props: { hatsTreeId: number; contextChainId: number; publicClient: PublicClient }) => {
async (params: { hatsTreeId: number; contextChainId: number; publicClient: PublicClient }) => {
try {
const tree = await hatsSubgraphClient.getTree({
chainId: props.contextChainId,
treeId: props.hatsTreeId,
chainId: params.contextChainId,
treeId: params.hatsTreeId,
props: {
hats: {
props: {
Expand Down Expand Up @@ -71,7 +71,7 @@ const useHatsTree = () => {
const cacheKey = {
cacheName: CacheKeys.IPFS_HASH,
hash,
chainId: props.contextChainId,
chainId: params.contextChainId,
} as const;

const cachedDetails = getValue(cacheKey);
Expand All @@ -96,12 +96,12 @@ const useHatsTree = () => {
try {
await setHatsTree({
hatsTree: treeWithFetchedDetails,
chainId: BigInt(props.contextChainId),
chainId: BigInt(params.contextChainId),
hatsProtocol,
erc6551Registry,
hatsAccountImplementation,
hatsElectionsImplementation,
publicClient: props.publicClient,
publicClient: params.publicClient,
whitelistingVotingStrategy:
linearVotingErc20WithHatsWhitelistingAddress ||
linearVotingErc721WithHatsWhitelistingAddress,
Expand All @@ -116,12 +116,12 @@ const useHatsTree = () => {
} catch (e) {
setHatsTree({
hatsTree: null,
chainId: BigInt(props.contextChainId),
chainId: BigInt(params.contextChainId),
hatsProtocol,
erc6551Registry,
hatsAccountImplementation,
hatsElectionsImplementation,
publicClient: props.publicClient,
publicClient: params.publicClient,
apolloClient,
sablierSubgraph,
});
Expand All @@ -130,8 +130,8 @@ const useHatsTree = () => {
console.error(e, {
message,
args: {
network: props.contextChainId,
hatsTreeId: props.hatsTreeId,
network: params.contextChainId,
hatsTreeId: params.hatsTreeId,
},
});
}
Expand Down

0 comments on commit f226c83

Please sign in to comment.