Show resetting state after game end
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user