mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-07 18:40:33 +00:00
♻️ load branding only if correctly subscribed
This commit is contained in:
@@ -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;
|
||||
});
|
||||
Reference in New Issue
Block a user