From 39e47e037590febb31b67648cae41e4c3205f61a Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Fri, 19 Nov 2021 14:01:30 +0000 Subject: [PATCH] Limit the length of poll questions and answers to 340 characters (#7166) --- src/components/views/elements/PollCreateDialog.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/views/elements/PollCreateDialog.tsx b/src/components/views/elements/PollCreateDialog.tsx index 8869286afa..7df62090ab 100644 --- a/src/components/views/elements/PollCreateDialog.tsx +++ b/src/components/views/elements/PollCreateDialog.tsx @@ -37,6 +37,8 @@ interface IState extends IScrollableBaseState { const MIN_OPTIONS = 2; const MAX_OPTIONS = 20; const DEFAULT_NUM_OPTIONS = 2; +const MAX_QUESTION_LENGTH = 340; +const MAX_OPTION_LENGTH = 340; export default class PollCreateDialog extends ScrollableBaseModal { private addOptionRef = createRef(); @@ -111,6 +113,7 @@ export default class PollCreateDialog extends ScrollableBaseModal{ _t("What is your poll question or topic?") }
this.onOptionChange(i, e)}