From c7516c4d7ad8085a655fc55ca2f555b5dfab0ad5 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:56:29 +0000 Subject: [PATCH] fix: delta stuff --- client/src/components/user/UGPTStatShowcase.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/components/user/UGPTStatShowcase.tsx b/client/src/components/user/UGPTStatShowcase.tsx index 29d07bcd8..3f8a4f2ee 100644 --- a/client/src/components/user/UGPTStatShowcase.tsx +++ b/client/src/components/user/UGPTStatShowcase.tsx @@ -264,8 +264,8 @@ function StatDelta({ game, playtype, }: { - v1: number; - v2?: number; + v1: number | null; + v2?: number | null; mode: "folder" | "chart"; metric: string; game: Game; @@ -277,6 +277,11 @@ function StatDelta({ v2 = 0; } + if (v1 === null) { + // eslint-disable-next-line no-param-reassign + v1 = 0; + } + const formattedV2 = FormatValue(game, playtype, mode, property, v2); const d = FormatValue(game, playtype, mode, property, v2 - v1);