Skip to content

Commit 3db57c5

Browse files
authored
fix: only show missing billing info banner if billing enabled (supabase#39121)
* fix: turn off all billing-related banners if billing disabled
1 parent 149963f commit 3db57c5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/studio/hooks/misc/useOrganizationRestrictions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useOrganizationsQuery } from 'data/organizations/organizations-query'
66
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
77
import { useBillingCustomerDataForm } from 'components/interfaces/Organization/BillingSettings/BillingCustomerData/useBillingCustomerDataForm'
88
import { useOrganizationCustomerProfileQuery } from 'data/organizations/organization-customer-profile-query'
9+
import { useIsFeatureEnabled } from './useIsFeatureEnabled'
910

1011
export type WarningBannerProps = {
1112
type: 'danger' | 'warning' | 'note'
@@ -23,6 +24,11 @@ export function useOrganizationRestrictions() {
2324

2425
const warnings: WarningBannerProps[] = []
2526

27+
const billingEnabled = useIsFeatureEnabled('billing:all')
28+
if (!billingEnabled) {
29+
return { warnings, org }
30+
}
31+
2632
const overdueInvoicesFromOtherOrgs = overdueInvoices?.filter(
2733
(invoice) => invoice.organization_id !== org?.id
2834
)

0 commit comments

Comments
 (0)