diff options
author | Miodec <[email protected]> | 2024-11-25 17:44:25 +0100 |
---|---|---|
committer | Miodec <[email protected]> | 2024-11-25 17:44:25 +0100 |
commit | 1141051716933007aca8953d15b44d00ae12b072 (patch) | |
tree | 074d25491bd0f2fbc54fdbbe9d2380a9ac6ff351 | |
parent | edf71da1c37d0bf77add75e845f21a42c51a4253 (diff) | |
download | monkeytype-1141051716933007aca8953d15b44d00ae12b072.tar.gz monkeytype-1141051716933007aca8953d15b44d00ae12b072.zip |
fix(custom text): limit being set to incorrect value when using pipe delimiter and simple text mode
!nuf
-rw-r--r-- | frontend/src/ts/modals/custom-text.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/frontend/src/ts/modals/custom-text.ts b/frontend/src/ts/modals/custom-text.ts index 37b07ae3a..ec0cd14eb 100644 --- a/frontend/src/ts/modals/custom-text.ts +++ b/frontend/src/ts/modals/custom-text.ts @@ -369,7 +369,10 @@ function apply(): void { CustomText.setPipeDelimiter(state.customTextPipeDelimiter); CustomText.setText(text); - if (state.customTextLimits.word !== "") { + if (state.customTextMode === "simple" && state.customTextPipeDelimiter) { + CustomText.setLimitMode("section"); + CustomText.setLimitValue(text.length); + } else if (state.customTextLimits.word !== "") { CustomText.setLimitMode("word"); CustomText.setLimitValue(parseInt(state.customTextLimits.word)); } else if (state.customTextLimits.time !== "") { |