From 238cf050ceaa966a57d0b32ec2ffaf067646ba27 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Wed, 8 May 2024 20:38:50 +0100 Subject: [PATCH] fix: terrible session dedup code --- .../components/sessions/SessionRaiseBreakdown.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/components/sessions/SessionRaiseBreakdown.tsx b/client/src/components/sessions/SessionRaiseBreakdown.tsx index c9510f833..ac252a127 100644 --- a/client/src/components/sessions/SessionRaiseBreakdown.tsx +++ b/client/src/components/sessions/SessionRaiseBreakdown.tsx @@ -160,13 +160,14 @@ function SessionScoreStatBreakdown({ e.score.chartID === score.chartID ); - if ( - alreadyInArray && - // @ts-expect-error not justifying this - alreadyInArray.score.scoreData.enumIndexes[enumValue] < enumIndex - ) { - alreadyInArray.score = score; - alreadyInArray.scoreInfo = scoreInfo; + if (alreadyInArray) { + if ( + // @ts-expect-error not justifying this + alreadyInArray.score.scoreData.enumIndexes[enumValue] < enumIndex + ) { + alreadyInArray.score = score; + alreadyInArray.scoreInfo = scoreInfo; + } } else { newEnums[metric][enumValue].push({ score,