Shorten expressions using the always-false property of undefined comparisons

This commit is contained in:
Stefano Pigozzi 2024-09-05 14:58:11 +02:00
parent 61946a8e67
commit 3fa9796941
No known key found for this signature in database
GPG key ID: 5ADA3868646C3FC0

View file

@ -226,7 +226,7 @@ function Compose({
const {
statuses: {
maxCharacters,
maxMediaAttachments,
maxMediaAttachments, // Beware: it can be undefined on *oma instances!
charactersReservedPerUrl,
} = {},
mediaAttachments: {
@ -1318,7 +1318,7 @@ function Compose({
<input
type="file"
accept={supportedMimeTypes?.join(',')}
multiple={maxMediaAttachments ? mediaAttachments.length < maxMediaAttachments - 1 : true}
multiple={!(mediaAttachments.length > maxMediaAttachments)}
disabled={
uiState === 'loading' ||
mediaAttachments.length >= maxMediaAttachments ||
@ -1410,7 +1410,7 @@ function Compose({
class="toolbar-button gif-picker-button"
disabled={
uiState === 'loading' ||
(maxMediaAttachments ? mediaAttachments.length >= maxMediaAttachments : true) ||
!(mediaAttachments.length < maxMediaAttachments) ||
!!poll
}
onClick={() => {