fix: count logic for PHP_INT_MAX on JS!

This commit is contained in:
Darshan
2025-02-28 12:43:45 +05:30
parent e77b95d9ac
commit a08709e821
+8 -1
View File
@@ -50,6 +50,13 @@
];
$: isFree = org.billingPlan === BillingPlan.FREE;
// equal or above means unlimited!
$: getCorrectSeatsCountValue = (count: number): string | number => {
// php int max is always larger than js
const exceedsSafeLimit = count >= Number.MAX_SAFE_INTEGER;
return exceedsSafeLimit ? 'Unlimited' : count || 0;
};
</script>
<Modal bind:show size="big" headerDivider={false} title="Usage rates">
@@ -81,7 +88,7 @@
<TableRow>
<TableCellText title="resource">{usage.resource}</TableCellText>
<TableCellText title="limit">
{plan.addons.seats.limit || 0}
{getCorrectSeatsCountValue(plan.addons.seats.limit)}
</TableCellText>
{#if !isFree}
<TableCellText title="rate">