mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-28 08:43:07 +08:00
todo
This commit is contained in:
parent
05fa8ae48f
commit
685668a6b8
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue