Skip to content

Commit 61bc0ad

Browse files
authored
Merge pull request #1711 from appwrite/fix-org-limit
Fix count
2 parents 3ee3821 + a08709e commit 61bc0ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib/components/billing/usageRates.svelte

+8-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
];
5151
5252
$: isFree = org.billingPlan === BillingPlan.FREE;
53+
54+
// equal or above means unlimited!
55+
$: getCorrectSeatsCountValue = (count: number): string | number => {
56+
// php int max is always larger than js
57+
const exceedsSafeLimit = count >= Number.MAX_SAFE_INTEGER;
58+
return exceedsSafeLimit ? 'Unlimited' : count || 0;
59+
};
5360
</script>
5461

5562
<Modal bind:show size="big" headerDivider={false} title="Usage rates">
@@ -81,7 +88,7 @@
8188
<TableRow>
8289
<TableCellText title="resource">{usage.resource}</TableCellText>
8390
<TableCellText title="limit">
84-
{plan.addons.seats.limit || 0}
91+
{getCorrectSeatsCountValue(plan.addons.seats.limit)}
8592
</TableCellText>
8693
{#if !isFree}
8794
<TableCellText title="rate">

0 commit comments

Comments
 (0)