fix: show correct user count when MAX_USERS is unlimited

MAX_USERS defaults to 0 (unlimited) but the People section displayed
"1 / 0 users". Now shows "1 user" when no limit is configured.
This commit is contained in:
ashim-hq
2026-04-23 22:08:34 +08:00
parent 8c5945362a
commit 2cf53acfa4
@@ -774,7 +774,7 @@ function PeopleSection() {
u.username.toLowerCase().includes(search.toLowerCase()),
);
const atLimit = users.length >= maxUsers;
const atLimit = maxUsers > 0 && users.length >= maxUsers;
const handleAddUser = useCallback(
async (e: React.FormEvent) => {
@@ -886,7 +886,9 @@ function PeopleSection() {
{/* User count */}
<p className="text-sm text-muted-foreground">
{users.length} / {maxUsers} users
{maxUsers > 0
? `${users.length} / ${maxUsers} users`
: `${users.length} ${users.length === 1 ? "user" : "users"}`}
</p>
{/* Action message */}