mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Patch subscription plan frontend validation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
export type SubscriptionPlan = {
|
||||
_id: string;
|
||||
membersUsed: number;
|
||||
membersLimit: number;
|
||||
memberLimit: number;
|
||||
auditLogs: boolean;
|
||||
customAlerts: boolean;
|
||||
customRateLimits: boolean;
|
||||
|
||||
@@ -61,7 +61,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
||||
const { subscription } = useSubscription();
|
||||
|
||||
const host = window.location.origin;
|
||||
const isAddingProjectsAllowed = ((subscription?.workspacesUsed || 1) < (subscription?.workspaceLimit || 3)) || host !== 'https://app.infisical.com';
|
||||
const isAddingProjectsAllowed = subscription?.workspaceLimit ? (subscription.workspacesUsed < subscription.workspaceLimit) : true;
|
||||
|
||||
const createWs = useCreateWorkspace();
|
||||
const uploadWsKey = useUploadWsKey();
|
||||
|
||||
@@ -60,7 +60,7 @@ export const OrgSettingsPage = () => {
|
||||
|
||||
const [completeInviteLink, setcompleteInviteLink] = useState<string | undefined>('');
|
||||
|
||||
const isMoreUsersNotAllowed = ((subscription?.membersUsed || 0) >= (subscription?.membersLimit || 1)) && host === 'https://app.infisical.com';
|
||||
const isMoreUsersNotAllowed = subscription?.memberLimit ? (subscription.membersUsed >= subscription.memberLimit) : false;
|
||||
|
||||
const onRenameOrg = async (name: string) => {
|
||||
if (!currentOrg?._id) return;
|
||||
|
||||
Reference in New Issue
Block a user