Added character count to alert message (#135)

This improvement adds additional information to the alert that is displayed when the user enters more characters than allowed in the rich text element. Now, the alert also shows the number of characters that the user has entered, which helps to provide clearer and more useful feedback to the use
This commit is contained in:
Ernesto Barrera authored and GitHub committed 2023-03-25 06:11:30 -06:00
1 parent 338ddedfec
commit 69e05160a3
1 file changed
+1 -1
+1 -1
View File
@@ -20,7 +20,7 @@ export const ChatInput: FC<Props> = ({ onSend, messageIsStreaming, model, stopCo
const maxLength = model.id === OpenAIModelID.GPT_3_5 ? 12000 : 24000; const maxLength = model.id === OpenAIModelID.GPT_3_5 ? 12000 : 24000;
if (value.length > maxLength) { if (value.length > maxLength) {
alert(`Message limit is ${maxLength} characters`); alert(`Message limit is ${maxLength} characters. You have entered ${value.length} characters.`);
return; return;
} }