Hide poll button if maxOptions <= 1
It's not a poll if there's only 1 option
This commit is contained in:
parent
6ccefaebe1
commit
9235d2c800
|
@ -1219,11 +1219,17 @@ function Compose({
|
|||
/>
|
||||
<Icon icon="attachment" />
|
||||
</label>{' '}
|
||||
{/* If maxOptions is not defined or defined and is greater than 1, show poll button */}
|
||||
{maxOptions == null ||
|
||||
(maxOptions > 1 && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
class="toolbar-button"
|
||||
disabled={
|
||||
uiState === 'loading' || !!poll || !!mediaAttachments.length
|
||||
uiState === 'loading' ||
|
||||
!!poll ||
|
||||
!!mediaAttachments.length
|
||||
}
|
||||
onClick={() => {
|
||||
setPoll({
|
||||
|
@ -1235,6 +1241,8 @@ function Compose({
|
|||
>
|
||||
<Icon icon="poll" alt="Add poll" />
|
||||
</button>{' '}
|
||||
</>
|
||||
))}
|
||||
<button
|
||||
type="button"
|
||||
class="toolbar-button"
|
||||
|
|
Loading…
Reference in a new issue