mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-06 22:56:49 +08:00
feat(result): disallow stop on error letter from getting new pbs
This commit is contained in:
parent
4a29e6a1be
commit
aa2466a0d1
3 changed files with 4 additions and 0 deletions
|
@ -91,6 +91,7 @@ const RESULT_SCHEMA = joi
|
|||
uid: joi.string().max(100).token().required(),
|
||||
wpm: joi.number().min(0).max(420).required(),
|
||||
wpmConsistency: joi.number().min(0).max(100).required(),
|
||||
stopOnLetter: joi.boolean().required(),
|
||||
})
|
||||
.required();
|
||||
|
||||
|
|
|
@ -422,6 +422,7 @@ export async function checkIfPb(
|
|||
const { mode } = result;
|
||||
|
||||
if (!canFunboxGetPb(result)) return false;
|
||||
if ("stopOnLetter" in result && result.stopOnLetter === true) return false;
|
||||
|
||||
if (mode === "quote") {
|
||||
return false;
|
||||
|
@ -467,6 +468,7 @@ export async function checkIfTagPb(
|
|||
|
||||
const { mode, tags: resultTags } = result;
|
||||
if (!canFunboxGetPb(result)) return [];
|
||||
if ("stopOnLetter" in result && result.stopOnLetter === true) return [];
|
||||
|
||||
if (mode === "quote") {
|
||||
return [];
|
||||
|
|
|
@ -797,6 +797,7 @@ function buildCompletedEvent(
|
|||
customText: customText,
|
||||
testDuration: duration,
|
||||
afkDuration: afkDuration,
|
||||
stopOnLetter: Config.stopOnError === "letter",
|
||||
} as SharedTypes.CompletedEvent;
|
||||
|
||||
if (completedEvent.mode !== "custom") delete completedEvent.customText;
|
||||
|
|
Loading…
Add table
Reference in a new issue