Skip to content

Commit 1f4e638

Browse files
nandajavarmaroboquat
authored andcommitted
[dashboard] handle unlimited users condition in license page
1 parent cc893be commit 1f4e638

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/dashboard/src/admin/License.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function License() {
3737
const features = license?.features;
3838

3939
// if user seats is 0, it means that there is no user limit in the license
40-
const userLimit = license?.seats == 0 ? "Unlimited" : license?.seats;
40+
const userLimit = license?.seats === 0 ? "Unlimited" : license?.seats;
4141

4242
const [licenseLevel, paid, statusMessage] = license ? getSubscriptionLevel(license) : defaultMessage();
4343

@@ -159,7 +159,8 @@ function professionalPlan(userCount: number, seats: number, trial: boolean, vali
159159
);
160160
};
161161

162-
const aboveLimit: boolean = userCount > seats;
162+
// seats === 0 means unlimited number of users
163+
const aboveLimit: boolean = seats === 0 ? false : userCount > seats;
163164

164165
const licenseTitle = () => {
165166
const expDate = new Date(validUntil);
@@ -206,7 +207,8 @@ function communityPlan(userCount: number, seats: number, fallbackAllowed: boolea
206207
}
207208
};
208209

209-
const aboveLimit: boolean = userCount > seats;
210+
// seats === 0 means unlimited number of users
211+
const aboveLimit: boolean = seats === 0 ? false : userCount > seats;
210212

211213
return [licenseLevel("Community"), additionalLicenseInfo("Free"), alertMessage(aboveLimit)];
212214
}

0 commit comments

Comments
 (0)