diff --git a/frontend/src/pages/RunEncounters.tsx b/frontend/src/pages/RunEncounters.tsx index a793dff..fa9e324 100644 --- a/frontend/src/pages/RunEncounters.tsx +++ b/frontend/src/pages/RunEncounters.tsx @@ -620,12 +620,19 @@ export function RunEncounters() { } }, [organizedRoutes, encounterByRoute]) // eslint-disable-line react-hooks/exhaustive-deps + const alive = useMemo( + () => [...normalEncounters, ...transferEncounters, ...shinyEncounters].filter( + (e) => e.status === 'caught' && e.faintLevel === null, + ), + [normalEncounters, transferEncounters, shinyEncounters], + ) + // Resolve HoF team encounters from IDs const hofTeam = useMemo(() => { if (!run?.hofEncounterIds || run.hofEncounterIds.length === 0) return null const idSet = new Set(run.hofEncounterIds) - return normalEncounters.filter((e) => idSet.has(e.id)) - }, [run?.hofEncounterIds, normalEncounters]) + return alive.filter((e) => idSet.has(e.id)) + }, [run?.hofEncounterIds, alive]) if (isLoading || loadingRoutes) { return ( @@ -679,9 +686,6 @@ export function RunEncounters() { } const isActive = run.status === 'active' - const alive = normalEncounters.filter( - (e) => e.status === 'caught' && e.faintLevel === null, - ) const dead = normalEncounters.filter( (e) => e.status === 'caught' && e.faintLevel !== null, )