mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(billing): gate org billing query to invite modal open state and allow GA doubleclick in CSP (#4328)
* fix(billing): gate org billing query to invite modal open state and allow GA doubleclick in CSP * fix(csp): drop redundant stats.g.doubleclick.net entry
This commit is contained in:
+3
-1
@@ -79,7 +79,9 @@ export function InviteModal({
|
||||
const { data: pendingInvitations = [], isLoading: isPendingInvitationsLoading } =
|
||||
usePendingInvitations(open ? workspaceId : undefined)
|
||||
|
||||
const { data: organizationBillingData } = useOrganizationBilling(organizationId ?? '')
|
||||
const { data: organizationBillingData } = useOrganizationBilling(organizationId ?? '', {
|
||||
enabled: open,
|
||||
})
|
||||
|
||||
const batchSendInvitations = useBatchSendWorkspaceInvitations()
|
||||
const cancelInvitation = useCancelWorkspaceInvitation()
|
||||
|
||||
@@ -201,11 +201,11 @@ async function fetchOrganizationBilling(orgId: string, signal?: AbortSignal) {
|
||||
/**
|
||||
* Hook to fetch organization billing data
|
||||
*/
|
||||
export function useOrganizationBilling(orgId: string) {
|
||||
export function useOrganizationBilling(orgId: string, options?: { enabled?: boolean }) {
|
||||
return useQuery({
|
||||
queryKey: organizationKeys.billing(orgId),
|
||||
queryFn: ({ signal }) => fetchOrganizationBilling(orgId, signal),
|
||||
enabled: !!orgId,
|
||||
enabled: !!orgId && (options?.enabled ?? true),
|
||||
retry: false,
|
||||
staleTime: 30 * 1000,
|
||||
placeholderData: keepPreviousData,
|
||||
|
||||
@@ -105,6 +105,7 @@ const STATIC_CONNECT_SRC = [
|
||||
'https://analytics.google.com',
|
||||
'https://www.google.com',
|
||||
'https://analytics.ahrefs.com',
|
||||
'https://*.g.doubleclick.net',
|
||||
]
|
||||
: []),
|
||||
] as const
|
||||
|
||||
Reference in New Issue
Block a user