From ac05135f5972bd16047e0590006763d638dd55cc Mon Sep 17 00:00:00 2001 From: Michael Ficocelli Date: Tue, 20 Feb 2024 17:36:06 -0500 Subject: [PATCH] IPVGO: Ensure favor text is only shown for even-numbered winstreaks, not even loss streaks (#1110) closes #1109 Ensure that loss streak tracking does not display the favor gain text, to avoid misleading players --- src/Go/ui/GoScorePowerSummary.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Go/ui/GoScorePowerSummary.tsx b/src/Go/ui/GoScorePowerSummary.tsx index b51d9c8f3..4febac522 100644 --- a/src/Go/ui/GoScorePowerSummary.tsx +++ b/src/Go/ui/GoScorePowerSummary.tsx @@ -25,6 +25,8 @@ export const GoScorePowerSummary = ({ finalScore, opponent }: IProps) => { const difficultyMultiplier = getDifficultyMultiplier(whiteScore.komi, Player.go.boardState.board[0].length); const winstreakMultiplier = getWinstreakMultiplier(winStreak, oldWinStreak); const nodePowerIncrease = formatNumber(blackScore.sum * difficultyMultiplier * winstreakMultiplier, 2); + const showFavorGain = + winStreak > 0 && winStreak % 2 === 0 && Player.factions.includes(opponent as unknown as FactionName); return ( <> @@ -89,7 +91,7 @@ export const GoScorePowerSummary = ({ finalScore, opponent }: IProps) => { - {winStreak && winStreak % 2 === 0 && Player.factions.includes(opponent as unknown as FactionName) ? ( + {showFavorGain ? (