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 {
11
11
getMarketplaceClient ,
12
12
} from '../../../../_internal' ;
13
13
import { useWallet } from '../../../../_internal/wallet/useWallet' ;
14
+ import { useAccount } from 'wagmi' ;
14
15
15
16
export interface UseGetTokenApprovalDataArgs {
16
17
chainId : string ;
@@ -29,6 +30,7 @@ export const useGetTokenApprovalData = (
29
30
) => {
30
31
const config = useConfig ( ) ;
31
32
const { wallet } = useWallet ( ) ;
33
+ const { address } = useAccount ( ) ;
32
34
const marketplaceClient = getMarketplaceClient ( params . chainId , config ) ;
33
35
34
36
const listing = {
@@ -39,10 +41,14 @@ export const useGetTokenApprovalData = (
39
41
expiry : String ( Number ( dateToUnixTime ( new Date ( ) ) ) + ONE_DAY_IN_SECONDS ) ,
40
42
} satisfies CreateReq ;
41
43
42
- const isEnabled = wallet && params . query ?. enabled !== false ;
44
+ const isEnabled =
45
+ wallet &&
46
+ address &&
47
+ ( params . query ?. enabled ?? true ) &&
48
+ ! ! params . currencyAddress ;
43
49
44
50
const { data, isLoading, isSuccess } = useQuery ( {
45
- queryKey : [ 'token-approval-data' , params . currencyAddress ] ,
51
+ queryKey : [ 'token-approval-data' , params , address ] ,
46
52
queryFn : isEnabled
47
53
? async ( ) => {
48
54
const args = {
You can’t perform that action at this time.
0 commit comments