diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-20 20:36:46 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-20 20:36:46 +0900 |
| commit | 4a2438201d0e365a873632a1ffcf913661eacbec (patch) | |
| tree | 4957be398046c34117c2c9041a5b7f47e0fcf97d /frontend/app | |
| parent | d030df50f009931980ea9e15c0df10c0b50a4bc8 (diff) | |
| download | phperkaigi-2025-albatross-4a2438201d0e365a873632a1ffcf913661eacbec.tar.gz phperkaigi-2025-albatross-4a2438201d0e365a873632a1ffcf913661eacbec.tar.zst phperkaigi-2025-albatross-4a2438201d0e365a873632a1ffcf913661eacbec.zip | |
fix(frontend): fix hydration error
Diffstat (limited to 'frontend/app')
| -rw-r--r-- | frontend/app/states/play.ts | 9 | ||||
| -rw-r--r-- | frontend/app/states/watch.ts | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/frontend/app/states/play.ts b/frontend/app/states/play.ts index 3acefbf..7bf4b4e 100644 --- a/frontend/app/states/play.ts +++ b/frontend/app/states/play.ts @@ -16,15 +16,14 @@ type ExecutionStatus = components["schemas"]["ExecutionStatus"]; type LatestGameState = components["schemas"]["LatestGameState"]; 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) { 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) { |
