Use the server setting to get the max number of poll options in UI (#29490)
This commit is contained in:
1 parent
6984f94044
commit
b9722dfe2b
3 files changed
+8
-6
No files matched your search
@@ -58,10 +58,11 @@ const Option = ({ multipleChoice, index, title, autoFocus }) => {
|
||||
const dispatch = useDispatch();
|
||||
const suggestions = useSelector(state => state.getIn(['compose', 'suggestions']));
|
||||
const lang = useSelector(state => state.getIn(['compose', 'language']));
|
||||
const maxOptions = useSelector(state => state.getIn(['server', 'server', 'configuration', 'polls', 'max_options']));
|
||||
|
||||
const handleChange = useCallback(({ target: { value } }) => {
|
||||
dispatch(changePollOption(index, value));
|
||||
}, [dispatch, index]);
|
||||
dispatch(changePollOption(index, value, maxOptions));
|
||||
}, [dispatch, index, maxOptions]);
|
||||
|
||||
const handleSuggestionsFetchRequested = useCallback(token => {
|
||||
dispatch(fetchComposeSuggestions(token));
|
||||
|
||||
Reference in new issue
Block a user