Skip to content

Commit

Permalink
Fix useUnclaimedNFTs hook return type (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
MananTank authored Jan 10, 2024
1 parent ece19ef commit 30f16ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/ten-jokes-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@thirdweb-dev/react-core": patch
---

Fix return type of `useUnclaimedNFTs` hook.

This fixes https://github.com/thirdweb-dev/js/issues/2110
8 changes: 5 additions & 3 deletions packages/react-core/src/evm/hooks/async/drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
UseQueryResult,
} from "@tanstack/react-query";
import type {
NFT,
NFTMetadata,
NFTMetadataInput,
QueryAllParams,
UploadProgressEvent,
Expand Down Expand Up @@ -87,7 +87,7 @@ import invariant from "tiny-invariant";
export function useUnclaimedNFTs(
contract: RequiredParam<NFTDrop>,
queryParams?: QueryAllParams,
): UseQueryResult<NFT[]> {
): UseQueryResult<NFTMetadata[]> {
const contractAddress = contract?.getAddress();
return useQueryWithNetwork(
cacheKeys.contract.nft.drop.getAllUnclaimed(contractAddress, queryParams),
Expand All @@ -98,7 +98,9 @@ export function useUnclaimedNFTs(
contract.getAllUnclaimed,
"Contract instance does not support getAllUnclaimed",
);
return contract.getAllUnclaimed(queryParams);
const data: Promise<NFTMetadata[]> =
contract.getAllUnclaimed(queryParams);
return data;
},
{ enabled: !!contract },
);
Expand Down

0 comments on commit 30f16ca

Please sign in to comment.