From 5fd50756b4c8fc0e2c87251108ad34d78e3b702e Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 22 Feb 2024 23:01:58 +0100 Subject: [PATCH] Restore glitch-soc's support of custom poll limits --- .../flavours/glitch/features/compose/components/poll_form.jsx | 3 ++- app/javascript/flavours/glitch/reducers/compose.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx index 8964121c57..34b35088fc 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.jsx @@ -15,6 +15,7 @@ import { selectComposeSuggestion, } from 'flavours/glitch/actions/compose'; import AutosuggestInput from 'flavours/glitch/components/autosuggest_input'; +import { pollLimits } from 'flavours/glitch/initial_state'; const messages = defineMessages({ option_placeholder: { id: 'compose_form.poll.option_placeholder', defaultMessage: 'Option {number}' }, @@ -83,7 +84,7 @@ const Option = ({ multipleChoice, index, title, autoFocus }) => { state.updateIn(['poll', 'options'], if (tmp.size === 0) { return tmp.push('').push(''); - } else if (tmp.size < 4) { + } else if (tmp.size < pollLimits.max_options) { return tmp.push(''); }