diff options
Diffstat (limited to 'frontend/app/states/watch.ts')
| -rw-r--r-- | frontend/app/states/watch.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/frontend/app/states/watch.ts b/frontend/app/states/watch.ts index 463c2cd..14a70b4 100644 --- a/frontend/app/states/watch.ts +++ b/frontend/app/states/watch.ts @@ -16,15 +16,14 @@ type LatestGameState = components["schemas"]["LatestGameState"]; type RankingEntry = components["schemas"]["RankingEntry"]; export const gameStateKindAtom = atom<GameStateKind>((get) => { - const startedAt = get(gameStartedAtAtom); - if (!startedAt) { - return "waiting"; - } - const now = get(currentTimestampAtom); if (!now) { return "loading"; } + const startedAt = get(gameStartedAtAtom); + if (!startedAt) { + return "waiting"; + } const durationSeconds = get(durationSecondsAtom); const finishedAt = startedAt + durationSeconds; if (now < startedAt) { |
