Default lobby cards to four-player capacity
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user