From 53f554d0be8edf8a182ea8ab59fc97cde509c70d Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 18 Nov 2022 06:35:41 -0500 Subject: [PATCH] disable form if too long --- .../src/v2/view/tts/tts_model_list/TtsModelListPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx b/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx index 3ff1cc7d6a..9cdde14b9e 100644 --- a/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx +++ b/packages/fakeyou/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx @@ -179,9 +179,6 @@ function TtsModelListPage(props: Props) { listTtsCategories(); }, [listModels, listTtsCategories]); - // TODO: I never did anything with this. - let remainingCharactersButtonDisabled = false; - const handleChangeText = (ev: React.FormEvent) => { const textValue = (ev.target as HTMLTextAreaElement).value; props.setTextBuffer(textValue); @@ -353,6 +350,9 @@ function TtsModelListPage(props: Props) { } } + // NB: If the text is too long, don't allow submission + let remainingCharactersButtonDisabled = props.textBuffer.trim().length > 1024; + return ( {bootstrapLanguageNotice}