Skip to content

fix(game): refetch the deck after the repository changes - #83

Merged
F88 merged 1 commit into
mainfrom
fix/80-reset-deck-on-repository-change-2026-11-09
Nov 9, 2026
Merged

F88 merged 1 commit into
mainfrom
fix/80-reset-deck-on-repository-change-2026-11-09

Conversation

@F88

@F88 F88 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Saving the token again replaces the repository with one that has an empty snapshot, because token validation uses limit: 0. lastApiParams was kept across that change, so the next deck with the same apiParams reused the empty snapshot and showed ✓ デッキ: 0 組.

useGameSetup now clears lastApiParams when the repository instance changes, so the next deck is fetched for the new repository.

Closes #80

Changes

  • src/hooks/use-game-setup.ts: clear lastApiParams during render when repository changes
  • src/hooks/use-game-setup.test.ts: tests for reusing the snapshot, and for fetching again after the repository is replaced
  • CHANGELOG.md: record the fix under [Unreleased]

Verification

  • typecheck, lint, format:check, tests (218), production build: passed
  • The new test for the replaced repository fails without this fix
  • Manually confirmed with the dev snapshot turned off: after saving the token again, the deck is fetched again

🤖 Generated with Claude Code

Saving the token again creates a repository with an empty snapshot,
but lastApiParams was kept, so the empty snapshot was reused.

Refs: #80

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

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9a4d61c

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 merged commit edf8f63 into main Nov 9, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deck becomes empty after saving the token again

1 participant