From 8dd5a412c51eca10c2a8cd46cc515b10a7d3cecb Mon Sep 17 00:00:00 2001 From: Jeremy Scheff Date: Fri, 11 Oct 2024 00:26:36 -0400 Subject: [PATCH] Fix off by one --- TODO | 1 - src/worker/views/playerGameLog.ts | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 370660c61..ffded69fe 100644 --- a/TODO +++ b/TODO @@ -7,7 +7,6 @@ Add blown saves (BS) and holds (HLD) - confirm exhibition game works - show decision in player game log (similar to box score, maybe reuse code form BoxScoreRow.football) - sort - - off by one, why is box score working correctly then? - no decision column for position players - blog diff --git a/src/worker/views/playerGameLog.ts b/src/worker/views/playerGameLog.ts index 53af1f48c..2e73795de 100644 --- a/src/worker/views/playerGameLog.ts +++ b/src/worker/views/playerGameLog.ts @@ -137,8 +137,11 @@ const updatePlayerGameLog = async ( for (const key of extraBaseballStats) { gameStats.seasonStats[key] = p.seasonStats[key]; gameStats[key] = p[key]; - if (gameStats[key] !== undefined) { + if (gameStats[key] > 0) { showDecisionColumn = true; + + // seasonStats is from before game, so add to reflect after game + gameStats.seasonStats[key] += gameStats[key]; } } }