fix: TypeScript build errors in RunEncounters.tsx
Use explicit BossResult type instead of indexing potentially undefined typeof bossResults. Add BossResultTeamMember type to tm parameter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,8 @@ import type {
|
||||
CreateEncounterInput,
|
||||
BossBattle,
|
||||
BossPokemon,
|
||||
BossResult,
|
||||
BossResultTeamMember,
|
||||
} from '../types'
|
||||
|
||||
type TeamSortKey = 'route' | 'level' | 'species' | 'dex'
|
||||
@@ -690,7 +692,7 @@ export function RunEncounters() {
|
||||
|
||||
// Map boss battle ID to result for team snapshot
|
||||
const bossResultByBattleId = useMemo(() => {
|
||||
const map = new Map<number, (typeof bossResults)[number]>()
|
||||
const map = new Map<number, BossResult>()
|
||||
if (bossResults) {
|
||||
for (const r of bossResults) {
|
||||
map.set(r.bossBattleId, r)
|
||||
@@ -1598,7 +1600,7 @@ export function RunEncounters() {
|
||||
<div className="mt-3 pt-3 border-t border-border-default">
|
||||
<p className="text-xs font-medium text-text-secondary mb-2">Your Team</p>
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{result.team.map((tm) => {
|
||||
{result.team.map((tm: BossResultTeamMember) => {
|
||||
const enc = encounterById.get(tm.encounterId)
|
||||
if (!enc) return null
|
||||
const dp = enc.currentPokemon ?? enc.pokemon
|
||||
|
||||
Reference in New Issue
Block a user