fix(testSettings): link with custom limit not applied correctly (@fehmer) (#6917)

fix for
https://www.reddit.com/r/monkeytype/comments/1n0p9fk/custom_timer_changes_to_number_of_words_when/
This commit is contained in:
Christian Fehmer 2025-08-27 19:04:26 +02:00 committed by GitHub
parent 9b93339ac1
commit 984cb3cd9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -200,6 +200,9 @@ export function loadTestSettingsFromUrl(getOverride?: string): void {
const customTextSettings = de[2];
CustomText.setText(customTextSettings.text);
//make sure to set mode before the limit as mode also sets the limit
CustomText.setMode(customTextSettings.mode ?? "repeat");
if (customTextSettings.limit !== undefined) {
CustomText.setLimitMode(customTextSettings.limit.mode);
CustomText.setLimitValue(customTextSettings.limit.value);
@ -226,8 +229,6 @@ export function loadTestSettingsFromUrl(getOverride?: string): void {
CustomText.setPipeDelimiter(true);
}
CustomText.setMode(customTextSettings.mode ?? "repeat");
applied["custom text settings"] = "";
}