Skip to content

Commit 7e8f519

Browse files
committed
fix(billing): keep the Marketplace lookup retry stable across renders
1 parent dd2a2cc commit 7e8f519

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/sim/hooks/queries/aws-marketplace.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useCallback } from 'react'
12
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
23
import { requestJson } from '@/lib/api/client/request'
34
import type { ContractBodyInput } from '@/lib/api/contracts'
@@ -76,11 +77,15 @@ export function useSaveAwsMarketplaceClaimContact() {
7677
*/
7778
export function useAwsMarketplaceBilling(organizationId: string | null) {
7879
const licenses = useAwsMarketplaceLicenses(organizationId)
80+
const { refetch } = licenses
81+
const retry = useCallback(() => {
82+
void refetch()
83+
}, [refetch])
7984
return {
8085
isResolved: licenses.data !== undefined,
8186
isError: licenses.isError,
8287
isRetrying: licenses.isFetching,
83-
retry: () => void licenses.refetch(),
88+
retry,
8489
billedThroughMarketplace:
8590
licenses.data?.some((license) => license.status !== 'inactive') ?? false,
8691
}

0 commit comments

Comments
 (0)