diff --git a/src/components/common/Reactions.tsx b/src/components/common/Reactions.tsx index 6eba192d..d64d721e 100644 --- a/src/components/common/Reactions.tsx +++ b/src/components/common/Reactions.tsx @@ -52,10 +52,7 @@ export const Reactions: React.FC<{ pageId: pageId, includeCharacter: size !== "sm", }) - const isMint = useCheckMint({ - address, - pageId: pageId, - }) + const isMint = useCheckMint(pageId) const like = async () => { if (!address) { diff --git a/src/queries/page.ts b/src/queries/page.ts index 43b943c1..b31a6eef 100644 --- a/src/queries/page.ts +++ b/src/queries/page.ts @@ -125,18 +125,15 @@ export const useGetMints = (input: { ) } -export const useCheckMint = (input: { address?: string; pageId?: string }) => { - return useQuery(["checkMint", input.pageId, input.address], async () => { - if (!input.pageId || !input.address) { - return { - count: 0, - list: [], - } +export const useCheckMint = (pageId: string | undefined) => { + const address = useAccountState((s) => s.wallet?.address) + + return useQuery(["checkMint", pageId, address], async () => { + if (!pageId || !address) { + return { count: 0, list: [] } } - return pageModel.checkMint({ - address: input.address, - pageId: input.pageId, - }) + + return pageModel.checkMint({ pageId, address }) }) }