Skip to content

Commit

Permalink
Cache fix for soulnames
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Feb 10, 2023
1 parent 2720741 commit e9586f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/helpers/provider/modules/soulnames/soulnames.ts
@@ -1,6 +1,7 @@
import { useQuery } from 'react-query';
import { Masa, SoulNameDetails } from '@masa-finance/masa-sdk';
import { BigNumber } from 'ethers';
import { useMemo } from 'react';

export const useSoulnames = (
masa: Masa | null,
Expand All @@ -17,12 +18,17 @@ export const useSoulnames = (
isLoading: boolean;
error: unknown;
} => {
const queryKey: string = useMemo(() => {
return `soulnames-${walletAddress}-${masa?.config.network}`;
}, [walletAddress, masa?.config.network]);

console.log(queryKey);
const {
data: soulnames,
status,
isLoading,
error,
} = useQuery(`soulnames-${walletAddress}`, () => masa?.soulName.list(), {
} = useQuery(queryKey, () => masa?.soulName.list(), {
enabled: !!masa && !!walletAddress && !!identity?.identityId,
});

Expand Down

0 comments on commit e9586f5

Please sign in to comment.