fix : UI flickering

This commit is contained in:
GuillaumeSD
2024-02-26 19:40:55 +01:00
parent 525f68f1fd
commit d5d1363da1
7 changed files with 35 additions and 21 deletions

View File

@@ -85,8 +85,8 @@ export const getEvaluationBarValue = (
): { whiteBarPercentage: number; label: string } => {
if (bestLine.mate) {
return {
whiteBarPercentage: whiteToPlay ? 100 : 0,
label: `M${bestLine.mate}`,
whiteBarPercentage: whiteToPlay && bestLine.mate > 0 ? 100 : 0,
label: `M${Math.abs(bestLine.mate)}`,
};
}