From 31456a7d39391395a5b6bc69f9b0bbcebae1d9d0 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 1 Aug 2022 21:36:08 +0100 Subject: [PATCH] fix: proper cbrk honoring --- client/src/components/tables/cells/IIDXLampCell.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/components/tables/cells/IIDXLampCell.tsx b/client/src/components/tables/cells/IIDXLampCell.tsx index 37bddd17f..12865b6cb 100644 --- a/client/src/components/tables/cells/IIDXLampCell.tsx +++ b/client/src/components/tables/cells/IIDXLampCell.tsx @@ -33,22 +33,25 @@ export default function IIDXLampCell({ bpText = `[BP: ${sc.scoreData.hitMeta.bp}]`; } + let cbrkCount; let cbrkText; - if ( + if (sc.scoreData.hitMeta.comboBreak) { + cbrkCount = sc.scoreData.hitMeta.comboBreak; + } else if ( IsNotNullish(sc.scoreData.judgements.pgreat) && IsNotNullish(sc.scoreData.judgements.great) && IsNotNullish(sc.scoreData.judgements.good) ) { - const cbrkCount = + cbrkCount = chart.data.notecount - sc.scoreData.judgements.pgreat! - sc.scoreData.judgements.great! - sc.scoreData.judgements.good!; + } - if (cbrkCount !== 0) { - cbrkText = `[CB: ${cbrkCount}]`; - } + if (IsNotNullish(cbrkCount)) { + cbrkText = `[CB: ${cbrkCount}]`; } return (