fix: prevent subscription info bar from rendering for client role users
- Added a condition to return null for the SubscriptionInfoBar component if the customer role is 'Client', ensuring that clients do not see the subscription information.
This commit is contained in:
parent
67cf9a8e26
commit
311f6c183d
@ -15,6 +15,8 @@ export function SubscriptionInfoBar() {
|
||||
|
||||
const { data: { customer } = {}, isLoading: isLoadingCustomer } = useCustomerQuery();
|
||||
|
||||
if (customer?.role === Enum_Customer_Role.Client) return null;
|
||||
|
||||
const isLoading = isLoadingCustomer || isLoadingSubscription || isLoadingSubscriptionSetting;
|
||||
|
||||
const isActive = data?.hasActiveSubscription;
|
||||
@ -36,8 +38,6 @@ export function SubscriptionInfoBar() {
|
||||
|
||||
if (!subscriptionSetting?.proEnabled) return null;
|
||||
|
||||
if (customer?.role === Enum_Customer_Role.Client) return null;
|
||||
|
||||
return (
|
||||
<Link href="/pro" rel="noopener noreferrer">
|
||||
<div className={cn('px-4', isLoading && 'animate-pulse')}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user