♻️ load branding only if correctly subscribed

This commit is contained in:
Fred KISSIE
2025-11-18 03:14:20 +01:00
parent e00c3f2193
commit e867de023a
2 changed files with 13 additions and 24 deletions

View File

@@ -4,7 +4,7 @@ import { cache } from "react";
import { getCachedSubscription } from "./getCachedSubscription";
import type { GetOrgTierResponse } from "@server/routers/billing/types";
export const isSubscribed = cache(async (orgId: string) => {
export const isOrgSubscribed = cache(async (orgId: string) => {
let subscriptionStatus: GetOrgTierResponse | null = null;
try {
const subRes = await getCachedSubscription(orgId);
@@ -14,7 +14,8 @@ export const isSubscribed = cache(async (orgId: string) => {
const subscribed =
build === "enterprise"
? true
: subscriptionStatus?.tier === TierId.STANDARD;
: subscriptionStatus?.tier === TierId.STANDARD &&
subscriptionStatus.active;
return subscribed;
});