File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/sdk/src/react/ui/modals/CreateListingModal/hooks Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 getMarketplaceClient ,
1212} from '../../../../_internal' ;
1313import { useWallet } from '../../../../_internal/wallet/useWallet' ;
14+ import { useAccount } from 'wagmi' ;
1415
1516export interface UseGetTokenApprovalDataArgs {
1617 chainId : string ;
@@ -29,6 +30,7 @@ export const useGetTokenApprovalData = (
2930) => {
3031 const config = useConfig ( ) ;
3132 const { wallet } = useWallet ( ) ;
33+ const { address } = useAccount ( ) ;
3234 const marketplaceClient = getMarketplaceClient ( params . chainId , config ) ;
3335
3436 const listing = {
@@ -39,10 +41,14 @@ export const useGetTokenApprovalData = (
3941 expiry : String ( Number ( dateToUnixTime ( new Date ( ) ) ) + ONE_DAY_IN_SECONDS ) ,
4042 } satisfies CreateReq ;
4143
42- const isEnabled = wallet && params . query ?. enabled !== false ;
44+ const isEnabled =
45+ wallet &&
46+ address &&
47+ ( params . query ?. enabled ?? true ) &&
48+ ! ! params . currencyAddress ;
4349
4450 const { data, isLoading, isSuccess } = useQuery ( {
45- queryKey : [ 'token-approval-data' , params . currencyAddress ] ,
51+ queryKey : [ 'token-approval-data' , params , address ] ,
4652 queryFn : isEnabled
4753 ? async ( ) => {
4854 const args = {
You can’t perform that action at this time.
0 commit comments