feat(queries/page): useCheckMint ignore email users

This commit is contained in:
Runjuu
2023-01-13 09:58:32 -08:00
parent 9c9d95831c
commit 3d0a9da7a4
2 changed files with 9 additions and 15 deletions
+1 -4
View File
@@ -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) {
+8 -11
View File
@@ -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 })
})
}