mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-25 07:17:23 +08:00
temporairly accepting both strings and numbers
This commit is contained in:
parent
251b7234a4
commit
6cf1f06d0d
2 changed files with 6 additions and 5 deletions
|
|
@ -34,7 +34,10 @@ const CONFIG_SCHEMA = joi.object({
|
|||
mode: joi.string().valid("time", "words", "quote", "zen", "custom"),
|
||||
quoteLength: joi.array().items(joi.number()),
|
||||
language: joi.string(),
|
||||
fontSize: joi.string().valid("1", "125", "15", "2", "3", "4"),
|
||||
fontSize: joi.alternatives().try(
|
||||
joi.number().valid(1, 125, 15, 2, 3, 4), //todo remove after a week
|
||||
joi.string().valid("1", "125", "15", "2", "3", "4")
|
||||
),
|
||||
freedomMode: joi.boolean(),
|
||||
difficulty: joi.string().valid("normal", "expert", "master"),
|
||||
blindMode: joi.boolean(),
|
||||
|
|
@ -45,10 +48,7 @@ const CONFIG_SCHEMA = joi.object({
|
|||
layout: joi.string(),
|
||||
funbox: joi.string(),
|
||||
confidenceMode: joi.string().valid("off", "on", "max"),
|
||||
indicateTypos: joi.alternatives().try(
|
||||
joi.boolean(), //todo remove
|
||||
joi.string().valid("off", "below", "replace")
|
||||
),
|
||||
indicateTypos: joi.string().valid("off", "below", "replace"),
|
||||
timerStyle: joi.string().valid("bar", "text", "mini"),
|
||||
colorfulMode: joi.boolean(),
|
||||
randomTheme: joi.string().valid("off", "on", "fav", "light", "dark"),
|
||||
|
|
|
|||
|
|
@ -1557,6 +1557,7 @@ export function setFontSize(
|
|||
fontSize: MonkeyTypes.FontSize,
|
||||
nosave?: boolean
|
||||
): void {
|
||||
fontSize = fontSize.toString() as MonkeyTypes.FontSize; //todo remove after around a week
|
||||
if (!isConfigValueValid(fontSize, [["1", "125", "15", "2", "3", "4"]]))
|
||||
return invalid("font size", fontSize);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue