mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-21 17:09:45 +08:00
fix: ensure funboxes are eligible for daily lbs
This commit is contained in:
parent
7a531d5597
commit
97f518f15b
1 changed files with 3 additions and 6 deletions
|
|
@ -40,6 +40,7 @@ import FunboxList from "../../constants/funbox-list";
|
|||
import _ from "lodash";
|
||||
import * as WeeklyXpLeaderboard from "../../services/weekly-xp-leaderboard";
|
||||
import { UAParser } from "ua-parser-js";
|
||||
import { canFunboxGetPb } from "../../utils/pb";
|
||||
|
||||
try {
|
||||
if (anticheatImplemented() === false) throw new Error("undefined");
|
||||
|
|
@ -421,13 +422,9 @@ export async function addResult(
|
|||
|
||||
let dailyLeaderboardRank = -1;
|
||||
|
||||
const { funbox, bailedOut } = result;
|
||||
const validResultCriteria =
|
||||
(funbox === "none" ||
|
||||
funbox === "plus_one" ||
|
||||
funbox === "plus_two" ||
|
||||
funbox === "plus_three") &&
|
||||
!bailedOut &&
|
||||
canFunboxGetPb(result) &&
|
||||
!result.bailedOut &&
|
||||
user.banned !== true &&
|
||||
user.lbOptOut !== true &&
|
||||
(process.env.MODE === "dev" || (user.timeTyping ?? 0) > 7200);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue