Skip to content

Commit

Permalink
Refacotring custom contracts dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Aug 24, 2023
1 parent e1ab96f commit 74c263c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/refactor/masa/use-custom-sbt.ts
Expand Up @@ -2,6 +2,7 @@ import type { Masa } from '@masa-finance/masa-sdk';
import { useQuery } from '@tanstack/react-query';

import { useAsyncFn } from 'react-use';
import { useMemo } from 'react';
import { MasaQueryClientContext, useMasaClient } from '../masa-client';
import { useConfig } from '../base-provider';
import { useCanQuery } from '../hooks/use-can-query';
Expand Down Expand Up @@ -127,6 +128,11 @@ export const useCustomSBTs = () => {
return hydratedContracts;
}, [canQuery, customContracts]);

const contracts = useMemo(
() => customContracts.map((contract: FullContract) => contract.address),
[customContracts]
);

const {
data: customSBTs,
status,
Expand All @@ -141,7 +147,7 @@ export const useCustomSBTs = () => {
sessionAddress,
masaAddress,
masaNetwork,
customContracts: customContracts?.length ?? 0,
contracts,
persist: false,
},
],
Expand Down

0 comments on commit 74c263c

Please sign in to comment.