mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
moved element update to test config instead of config
This commit is contained in:
parent
0ed2e89f6d
commit
a18774878f
1 changed files with 21 additions and 0 deletions
|
|
@ -129,6 +129,21 @@ export function update(
|
|||
);
|
||||
}
|
||||
|
||||
export function updateExtras(
|
||||
key: string,
|
||||
value: MonkeyTypes.ConfigValues
|
||||
): void {
|
||||
if (key == "time") {
|
||||
$("#testConfig .time.textButton").removeClass("active");
|
||||
const timeCustom = ![15, 30, 60, 120].includes(value as number)
|
||||
? "custom"
|
||||
: value;
|
||||
$("#testConfig .time.textButton[timeConfig='" + timeCustom + "']").addClass(
|
||||
"active"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function showFavoriteQuoteLength(): void {
|
||||
$("#top .desktopConfig .group.quoteLength .favorite").removeClass("hidden");
|
||||
}
|
||||
|
|
@ -143,5 +158,11 @@ ConfigEvent.subscribe((eventKey, eventValue, _nosave, eventPreviousValue) => {
|
|||
eventPreviousValue as MonkeyTypes.Mode,
|
||||
eventValue as MonkeyTypes.Mode
|
||||
);
|
||||
} else if (
|
||||
["time", "quoteLength", "words", "numbers", "punctuation"].includes(
|
||||
eventKey
|
||||
)
|
||||
) {
|
||||
updateExtras(eventKey, eventValue);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue