Skip to content

fix(game): restore the selected deck after reload - #85

Merged
F88 merged 1 commit into
mainfrom
fix/81-restore-deck-after-reload-2026-11-09
Nov 10, 2026
Merged

F88 merged 1 commit into
mainfrom
fix/81-restore-deck-after-reload-2026-11-09

Conversation

@F88

@F88 F88 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

The selected deck was not restored after reloading the page.

The save effect ran on mount and wrote selectedDeckRecipeId: null before the repository was ready. By the time the restore effect could run, the saved id was gone.

The save effect now keeps the saved deck id until the repository is available. Once it is available, behaviour is unchanged.

After a reload, saving the token now also fetches the restored deck.

Verification

  • New regression test: fails without the fix (expected null to be 'eto-ne'), passes with it.
  • format:check, lint, typecheck and tests (219) pass.
  • Checked in the browser with VITE_USE_DEV_SNAPSHOT=false: the deck and its card count come back after a reload and saving the token, and requests do not repeat.

Closes #81

🤖 Generated with Claude Code

The save effect wrote null on mount, before the repository was ready,
so the restore effect had nothing to read. Keep the saved deck id
until the repository is available.

Refs: #81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: faf10b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@F88 F88 added the bug Something isn't working label Nov 10, 2026
@F88
F88 merged commit 519a24e into main Nov 10, 2026
1 check passed
@F88 F88 mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected deck is not restored after a reload

1 participant