@ -106,7 +106,10 @@ export const MembersList = () => {
|
||||
)}
|
||||
{workspace && (
|
||||
<Heading fontSize="2xl">
|
||||
Members ({currentMembersCount}/{getSeatsLimit(workspace)})
|
||||
Members{' '}
|
||||
{getSeatsLimit(workspace) === -1
|
||||
? ''
|
||||
: `(${currentMembersCount}/${getSeatsLimit(workspace)})`}
|
||||
</Heading>
|
||||
)}
|
||||
{workspace?.id && canEdit && (
|
||||
|
@ -12,8 +12,12 @@ export function checkCanInviteMember({
|
||||
}) {
|
||||
if (!plan || !currentMembersCount) return false
|
||||
|
||||
return (
|
||||
getSeatsLimit({ plan, customSeatsLimit: customSeatsLimit ?? null }) >
|
||||
currentMembersCount
|
||||
)
|
||||
const seatsLimit = getSeatsLimit({
|
||||
plan,
|
||||
customSeatsLimit: customSeatsLimit ?? null,
|
||||
})
|
||||
|
||||
if (seatsLimit === -1) return true
|
||||
|
||||
return seatsLimit > currentMembersCount
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Plan } from 'db'
|
||||
|
||||
export const parseWorkspaceDefaultPlan = (userEmail: string) => {
|
||||
if (process.env.ADMIN_EMAIL === userEmail) return Plan.LIFETIME
|
||||
if (process.env.ADMIN_EMAIL === userEmail) return Plan.UNLIMITED
|
||||
const defaultPlan = process.env.DEFAULT_WORKSPACE_PLAN as Plan | undefined
|
||||
if (defaultPlan && Object.values(Plan).includes(defaultPlan))
|
||||
return defaultPlan
|
||||
|
Reference in New Issue
Block a user