From 685668a6b89e713d775985d03cdb6d3dfebb3d66 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 18 Jul 2023 19:14:36 +0200 Subject: [PATCH] todo --- backend/src/utils/pb.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/utils/pb.ts b/backend/src/utils/pb.ts index ee58894eb..45a462129 100644 --- a/backend/src/utils/pb.ts +++ b/backend/src/utils/pb.ts @@ -33,16 +33,15 @@ export function checkAndUpdatePb( lbPersonalBests: MonkeyTypes.LbPersonalBests | undefined, result: Result ): CheckAndUpdatePbResult { - // TODO: find a better way to type this - const mode = result.mode as "time"; + const mode = result.mode; const mode2 = result.mode2 as MonkeyTypes.Mode2<"time">; const userPb = userPersonalBests ?? {}; userPb[mode] ??= {}; userPb[mode][mode2] ??= []; - const personalBestMatch = userPb[mode][mode2].find((pb) => - matchesPersonalBest(result, pb) + const personalBestMatch = userPb[mode][mode2].find( + (pb: MonkeyTypes.PersonalBest) => matchesPersonalBest(result, pb) ); let isPb = true;