Fix run deletion crash and transfer modal initialization error

Run deletion now properly cleans up boss_results, genlocke_transfers,
and genlocke_leg references before deleting the run. Also fix
showTransferModal being referenced before initialization in
RunEncounters by moving its useState declaration above useLegSurvivors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-09 11:28:22 +01:00
parent c5910ec75c
commit e1dac10d27
3 changed files with 35 additions and 4 deletions

View File

@@ -396,6 +396,7 @@ export function RunEncounters() {
const runIdNum = Number(runId)
const { data: run, isLoading, error } = useRun(runIdNum)
const advanceLeg = useAdvanceLeg()
const [showTransferModal, setShowTransferModal] = useState(false)
const { data: survivors } = useLegSurvivors(
run?.genlocke?.genlockeId ?? 0,
run?.genlocke?.legOrder ?? 0,
@@ -423,7 +424,6 @@ export function RunEncounters() {
const [showHofModal, setShowHofModal] = useState(false)
const [showShinyModal, setShowShinyModal] = useState(false)
const [showEggModal, setShowEggModal] = useState(false)
const [showTransferModal, setShowTransferModal] = useState(false)
const [expandedBosses, setExpandedBosses] = useState<Set<number>>(new Set())
const [showTeam, setShowTeam] = useState(true)
const [filter, setFilter] = useState<'all' | RouteStatus>('all')