diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-06-03 19:23:33 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-03 19:23:33 -0700 |
| commit | e54a03e1329bd4711203ec8d49afcc1b095796af (patch) | |
| tree | 5266148bdf535a07061337a3d991764ee4c95c41 /src/components/Result/index.tsx | |
| parent | 9244e32b4fd3c9c0013c99b7f7709cc7e723a6f3 (diff) | |
obfuscate solution in local storage, fix progress persistence
Diffstat (limited to 'src/components/Result/index.tsx')
| -rw-r--r-- | src/components/Result/index.tsx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/components/Result/index.tsx b/src/components/Result/index.tsx index 6b4560a..4ce7f35 100644 --- a/src/components/Result/index.tsx +++ b/src/components/Result/index.tsx @@ -100,14 +100,17 @@ export function Result({ mode = "daily", onPlayAgain, }: Props) { - const hoursToNextDay = Math.floor( - (new Date(new Date().setHours(24, 0, 0, 0)).getTime() - - new Date().getTime()) / - 1000 / - 60 / - 60 + const now = new Date(); + const nextUtcMidnight = Date.UTC( + now.getUTCFullYear(), + now.getUTCMonth(), + now.getUTCDate() + 1, + 0, 0, 0 ); + const hoursToNextDay = Math.floor( + (nextUtcMidnight - now.getTime()) / 1000 / 60 / 60 + ); const isUnlimited = mode === "unlimited"; if (didGuess) { |
