Show resetting state after game end

This commit is contained in:
2026-09-19 22:50:17 -04:00
parent f975911204
commit 5985959882
7 changed files with 88 additions and 9 deletions
+6 -1
View File
@@ -154,6 +154,7 @@
let effectiveInactiveSince = $derived<string | null>(server?.inactive_since ?? null);
let effectiveGameStartedAt = $derived<string | null>(server?.game_started_at ?? null);
let effectiveGameEndedAt = $derived<string | null>(server?.game_ended_at ?? null);
let resetElapsed = $derived(fresh && effectiveGameEndedAt && server?.last_players !== 0 ? elapsedSince(effectiveGameEndedAt, $uiNow) : null);
let activeElapsed = $derived(fresh && effectiveActiveSince ? elapsedSince(effectiveActiveSince, $uiNow) : null);
let inactiveElapsed = $derived(fresh && effectiveInactiveSince ? elapsedSince(effectiveInactiveSince, $uiNow) : null);
let gameInProgress = $derived(!!effectiveGameStartedAt && !effectiveGameEndedAt && !!effectiveActiveSince);
@@ -260,7 +261,11 @@
<div class="sub">{gametypeLabel(effectiveGametype)}</div>
{/if}
</div>
{#if activeElapsed}
{#if resetElapsed}
<div class="metric-cell">
<Stat label="Resetting" value={resetElapsed} size="md" tween={false} />
</div>
{:else if activeElapsed}
<div class="metric-cell">
<Stat label="Active for" value={activeElapsed} size="md" tween={false} />
</div>