Merge branch 'single-option-polls' into 'main'

allow for creating single-option polls

See merge request soapbox-pub/soapbox!3364
merge-requests/3364/merge
sneed social 2025-04-11 09:25:30 +00:00
commit bc38a8557e
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -61,7 +61,7 @@ const Option: React.FC<IOption> = ({
const handleOptionTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => onChange(index, event.target.value);
const handleOptionRemove = () => {
if (numOptions > 2) {
if (numOptions > 1) {
onRemove(index);
} else {
onRemovePoll();
@ -100,7 +100,7 @@ const Option: React.FC<IOption> = ({
/>
</HStack>
{index > 1 && (
{index > 0 && (
<div>
<Button theme='danger' size='sm' onClick={handleOptionRemove}>
<FormattedMessage id='compose_form.poll.remove_option' defaultMessage='Remove this answer' />