diff --git a/packages/common/src/api/tan-query/coins/useFanClubs.ts b/packages/common/src/api/tan-query/coins/useFanClubs.ts index 6bf50544c7b..1a83c57a877 100644 --- a/packages/common/src/api/tan-query/coins/useFanClubs.ts +++ b/packages/common/src/api/tan-query/coins/useFanClubs.ts @@ -133,9 +133,9 @@ export const useFanClubs = ( // Otherwise, return the next offset return allPages.length * pageSize }, - enabled: options?.enabled !== false, select: options?.select ?? ((data) => data.pages.flat() as TData), - ...options + ...options, + enabled: options?.enabled !== false }) } diff --git a/packages/common/src/api/tan-query/coins/useWalletCoins.ts b/packages/common/src/api/tan-query/coins/useWalletCoins.ts index f37fbb1f44b..967872eb19c 100644 --- a/packages/common/src/api/tan-query/coins/useWalletCoins.ts +++ b/packages/common/src/api/tan-query/coins/useWalletCoins.ts @@ -79,7 +79,7 @@ export const useWalletCoins = ( } return [] }, - enabled: options?.enabled !== false && !!params.walletAddress, - ...options + ...options, + enabled: options?.enabled !== false && !!params.walletAddress }) } diff --git a/packages/common/src/api/tan-query/events/useUserRemixContests.ts b/packages/common/src/api/tan-query/events/useUserRemixContests.ts index 39fa0b67985..9df9303ac93 100644 --- a/packages/common/src/api/tan-query/events/useUserRemixContests.ts +++ b/packages/common/src/api/tan-query/events/useUserRemixContests.ts @@ -138,7 +138,7 @@ export const useUserRemixContests = ( .filter(removeNullable) }, select: (data) => data.pages.flat(), - enabled: options?.enabled !== false && !!userId, - ...options + ...options, + enabled: options?.enabled !== false && !!userId }) } diff --git a/packages/common/src/api/tan-query/jupiter/useCoinExchangeRate.ts b/packages/common/src/api/tan-query/jupiter/useCoinExchangeRate.ts index c0171b77136..32727b80dbb 100644 --- a/packages/common/src/api/tan-query/jupiter/useCoinExchangeRate.ts +++ b/packages/common/src/api/tan-query/jupiter/useCoinExchangeRate.ts @@ -422,7 +422,8 @@ export const useCoinExchangeRate = ( ) } }, - enabled: !!params.inputMint && !!params.outputMint, - ...options + ...options, + enabled: + !!params.inputMint && !!params.outputMint && options?.enabled !== false }) } diff --git a/packages/common/src/api/tan-query/playlist-updates/usePlaylistUpdates.ts b/packages/common/src/api/tan-query/playlist-updates/usePlaylistUpdates.ts index 6a090008574..883f1611f59 100644 --- a/packages/common/src/api/tan-query/playlist-updates/usePlaylistUpdates.ts +++ b/packages/common/src/api/tan-query/playlist-updates/usePlaylistUpdates.ts @@ -57,10 +57,10 @@ export const usePlaylistUpdates = ( playlistUpdateFromSDK ) }, - enabled: !!currentUserId, refetchInterval: PLAYLIST_UPDATES_POLLING_FREQ_MS, refetchOnWindowFocus: true, - ...options + ...options, + enabled: !!currentUserId && options?.enabled !== false }) } diff --git a/packages/common/src/api/tan-query/remixes/useRemixes.ts b/packages/common/src/api/tan-query/remixes/useRemixes.ts index ba836b076e0..450c732c945 100644 --- a/packages/common/src/api/tan-query/remixes/useRemixes.ts +++ b/packages/common/src/api/tan-query/remixes/useRemixes.ts @@ -161,8 +161,8 @@ export const useRemixes = ( type: EntityType.TRACK })) }, - enabled: options?.enabled !== false && !!trackId, - ...options + ...options, + enabled: options?.enabled !== false && !!trackId }) return queryData @@ -198,7 +198,7 @@ export const useRemixesCount = ( dispatch(remixesPageActions.setCount({ count })) return count }, - enabled: options?.enabled !== false && !!trackId, - ...options + ...options, + enabled: options?.enabled !== false && !!trackId }) } diff --git a/packages/common/src/api/tan-query/users/account/useCurrentAccount.ts b/packages/common/src/api/tan-query/users/account/useCurrentAccount.ts index 902bbfa8e36..bc8d483fb92 100644 --- a/packages/common/src/api/tan-query/users/account/useCurrentAccount.ts +++ b/packages/common/src/api/tan-query/users/account/useCurrentAccount.ts @@ -176,7 +176,7 @@ export const useCurrentAccount = ( getLocalAccountPlaceholder(localStorage, queryClient), staleTime: Infinity, gcTime: Infinity, - enabled: options?.enabled !== false && !!currentUserWallet, - ...options + ...options, + enabled: options?.enabled !== false && !!currentUserWallet }) } diff --git a/packages/common/src/api/tan-query/users/account/useManagers.ts b/packages/common/src/api/tan-query/users/account/useManagers.ts index 7b2351f72dc..6e12ea08328 100644 --- a/packages/common/src/api/tan-query/users/account/useManagers.ts +++ b/packages/common/src/api/tan-query/users/account/useManagers.ts @@ -32,7 +32,7 @@ export const useManagers = ( const data = rawData.filter((g: any) => g.grant.isApproved !== false) return userManagerListFromSDK(data) as TResult }, - enabled: isValidId(userId), - ...options + ...options, + enabled: isValidId(userId) && options?.enabled !== false }) } diff --git a/packages/common/src/api/tan-query/wallets/useCoinBalance.ts b/packages/common/src/api/tan-query/wallets/useCoinBalance.ts index b255ee00215..e85c272be31 100644 --- a/packages/common/src/api/tan-query/wallets/useCoinBalance.ts +++ b/packages/common/src/api/tan-query/wallets/useCoinBalance.ts @@ -60,10 +60,10 @@ export const useCoinBalance = ({ includeStaked }, { - enabled: isAudio, refetchInterval: isPolling ? pollingInterval : undefined, refetchOnWindowFocus: !isPolling, - ...queryOptions + ...queryOptions, + enabled: isAudio && queryOptions.enabled !== false } ) diff --git a/packages/common/src/api/tan-query/wallets/useDestinationUsdcAccountCheck.ts b/packages/common/src/api/tan-query/wallets/useDestinationUsdcAccountCheck.ts index 3d9570fe7a1..83902f996c4 100644 --- a/packages/common/src/api/tan-query/wallets/useDestinationUsdcAccountCheck.ts +++ b/packages/common/src/api/tan-query/wallets/useDestinationUsdcAccountCheck.ts @@ -91,8 +91,8 @@ export const useDestinationUsdcAccountCheck = ( return { hasUsdcAccount: false, ataCreationFeeUsdc } }, - enabled: isValidAddress && options?.enabled !== false, staleTime: 60_000, - ...options + ...options, + enabled: isValidAddress && options?.enabled !== false }) } diff --git a/packages/common/src/api/tan-query/wallets/useUSDCBalance.ts b/packages/common/src/api/tan-query/wallets/useUSDCBalance.ts index 76f577bfe71..f73b2d25159 100644 --- a/packages/common/src/api/tan-query/wallets/useUSDCBalance.ts +++ b/packages/common/src/api/tan-query/wallets/useUSDCBalance.ts @@ -96,12 +96,12 @@ export const useUSDCBalance = ({ throw e } }, - enabled: !!ethAddress, // TanStack Query's built-in polling - only poll when isPolling is true refetchInterval: isPolling ? pollingInterval : false, // Prevent refetching when window regains focus during polling to avoid conflicts refetchOnWindowFocus: !isPolling, - ...queryOptions + ...queryOptions, + enabled: !!ethAddress && queryOptions.enabled !== false }) // Map TanStack Query states to the Status enum for API compatibility diff --git a/packages/common/src/api/tan-query/wallets/useUserBalanceHistory.ts b/packages/common/src/api/tan-query/wallets/useUserBalanceHistory.ts index 53d40eb18fb..240c3361eb6 100644 --- a/packages/common/src/api/tan-query/wallets/useUserBalanceHistory.ts +++ b/packages/common/src/api/tan-query/wallets/useUserBalanceHistory.ts @@ -86,7 +86,7 @@ export const useUserBalanceHistory = ( })) ?? [] ) }, - enabled: options?.enabled !== false && !!params.userId, - ...options + ...options, + enabled: options?.enabled !== false && !!params.userId }) } diff --git a/packages/common/src/hooks/useMintRecovery.ts b/packages/common/src/hooks/useMintRecovery.ts index 83f4f37ea2b..bb132d503ed 100644 --- a/packages/common/src/hooks/useMintRecovery.ts +++ b/packages/common/src/hooks/useMintRecovery.ts @@ -50,10 +50,10 @@ export const useMintRecovery = ( return BigInt(0) } }, - enabled: options?.enabled !== false && !!mint, refetchInterval: 2000, // Poll every 2 seconds refetchOnWindowFocus: true, ...options, + enabled: options?.enabled !== false && !!mint, select: (balance: bigint) => { // If there's a balance, trigger recovery if (balance > BigInt(0)) { diff --git a/packages/common/src/hooks/useUserbank.ts b/packages/common/src/hooks/useUserbank.ts index b13e7a4145c..b0d0b6a12e5 100644 --- a/packages/common/src/hooks/useUserbank.ts +++ b/packages/common/src/hooks/useUserbank.ts @@ -38,8 +38,8 @@ export const useUserbank = ( }) return accountInfo.toString() }, - enabled: options?.enabled !== false && !!mint && !!wallet, - ...options + ...options, + enabled: options?.enabled !== false && !!mint && !!wallet }) return {