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:
@@ -9,6 +9,7 @@ import type { Route, RouteEncounterDetail } from '../types'
|
||||
|
||||
interface ShinyEncounterModalProps {
|
||||
routes: Route[]
|
||||
gameId: number
|
||||
onSubmit: (data: {
|
||||
routeId: number
|
||||
pokemonId: number
|
||||
@@ -41,6 +42,7 @@ function groupByMethod(pokemon: RouteEncounterDetail[]): { method: string; pokem
|
||||
|
||||
export function ShinyEncounterModal({
|
||||
routes,
|
||||
gameId,
|
||||
onSubmit,
|
||||
onClose,
|
||||
isPending,
|
||||
@@ -48,6 +50,7 @@ export function ShinyEncounterModal({
|
||||
const [selectedRouteId, setSelectedRouteId] = useState<number | null>(null)
|
||||
const { data: routePokemon, isLoading: loadingPokemon } = useRoutePokemon(
|
||||
selectedRouteId,
|
||||
gameId,
|
||||
)
|
||||
|
||||
const [selectedPokemon, setSelectedPokemon] =
|
||||
|
||||
Reference in New Issue
Block a user