Default lobby cards to four-player capacity

This commit is contained in:
2026-10-07 23:53:01 -04:00
parent 92c50e62a1
commit e514d21b74
2 changed files with 11 additions and 7 deletions
+3 -2
View File
@@ -65,7 +65,8 @@
const currentRound = $derived(!gameEndedAt ? (round !== undefined ? round : reportedRound) : null);
const gameElapsed = $derived(gameStartedAt && !gameEndedAt ? elapsedSince(gameStartedAt, $uiNow) : null);
const emptyElapsed = $derived(elapsedSince(inactiveSince, $uiNow));
const knownCapacity = $derived(capacity !== null && Number.isFinite(capacity) && capacity > 0 ? capacity : null);
// These lobbies have four slots when the live status omits the limit.
const displayCapacity = $derived(capacity !== null && Number.isSafeInteger(capacity) && capacity > 0 ? capacity : 4);
const cardStyle = $derived(`view-transition-name: server-${name.replace(/[^a-z0-9_-]/gi, '-')};`);
</script>
@@ -90,7 +91,7 @@
{#if showMap}<p class="map-note">{health === 'online' ? 'Current map' : 'Last map'}: {mapLabel}</p>{/if}
{#if health === 'online'}
<dl class="metrics">
<div><dt>Players</dt><dd title={knownCapacity === null ? 'Capacity unavailable' : `${knownCapacity} player capacity`}>{players ?? '—'}<span class="capacity">/{knownCapacity ?? '?'}</span></dd></div>
<div><dt>Players</dt><dd title={`${displayCapacity} player capacity`}>{players ?? '—'}<span class="capacity">/{displayCapacity}</span></dd></div>
<div><dt>Round</dt><dd>{currentRound ?? '—'}</dd></div>
<div><dt>Match time</dt><dd>{gameElapsed ?? '—'}</dd></div>
</dl>