Fix doubled encounters in encounter modals by filtering on gameId

EncounterModal and ShinyEncounterModal were calling useRoutePokemon
without a gameId, returning encounters for all games in the version
group. Now both receive and pass the run's gameId to scope results
to the current game only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 12:18:12 +01:00
parent 3e88ba50fa
commit da9cf0acd2
4 changed files with 22 additions and 3 deletions

View File

@@ -218,7 +218,7 @@ function RouteGroup({
<img
src={groupEncounter.pokemon.spriteUrl}
alt={groupEncounter.pokemon.name}
className="w-5 h-5"
className="w-10 h-10"
/>
)}
<span className="text-xs text-gray-500 dark:text-gray-400 capitalize">
@@ -972,7 +972,7 @@ export function RunEncounters() {
<img
src={encounter.pokemon.spriteUrl}
alt={encounter.pokemon.name}
className="w-5 h-5"
className="w-10 h-10"
/>
)}
<span className="text-xs text-gray-500 dark:text-gray-400 capitalize">
@@ -1116,6 +1116,7 @@ export function RunEncounters() {
{selectedRoute && (
<EncounterModal
route={selectedRoute}
gameId={run!.gameId}
existing={editingEncounter ?? undefined}
dupedPokemonIds={dupedPokemonIds}
onSubmit={handleCreate}
@@ -1132,6 +1133,7 @@ export function RunEncounters() {
{showShinyModal && routes && (
<ShinyEncounterModal
routes={routes}
gameId={run!.gameId}
onSubmit={handleCreate}
onClose={() => setShowShinyModal(false)}
isPending={createEncounter.isPending}