mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 08:13:28 +08:00
fixed pbs not working with funboxes
This commit is contained in:
parent
009c79350b
commit
985ef5959e
1 changed files with 12 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
import _ from "lodash";
|
||||
import FunboxesMetadata from "../constants/funbox-list";
|
||||
import FunboxList from "../constants/funbox-list";
|
||||
|
||||
interface CheckAndUpdatePbResult {
|
||||
isPb: boolean;
|
||||
|
@ -15,9 +15,17 @@ export function canFunboxGetPb(
|
|||
const funbox = result.funbox;
|
||||
if (!funbox || funbox === "none") return true;
|
||||
|
||||
return funbox
|
||||
.split("#")
|
||||
.every((funboxName) => FunboxesMetadata[funboxName]?.canGetPb === true);
|
||||
let ret = true;
|
||||
const resultFunboxes = funbox.split("#");
|
||||
for (const funbox of FunboxList) {
|
||||
if (resultFunboxes.includes(funbox.name)) {
|
||||
if (!funbox.canGetPb) {
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function checkAndUpdatePb(
|
||||
|
|
Loading…
Reference in a new issue