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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user