diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index cad6ac0c3..d46d8c8e2 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -14,7 +14,6 @@ import type { Signal } from '../../../util/signals'; import { BASE_EMOJI_KEYWORD_LANG, EDITABLE_INPUT_MODAL_ID, - GIF_MIME_TYPE, SUPPORTED_AUDIO_CONTENT_TYPES, SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES, @@ -355,7 +354,7 @@ const AttachmentModal: FC = ({ const handleEnableSpoilers = useLastCallback(() => { onAttachmentsUpdate(attachments.map((a) => ({ ...a, - shouldSendAsSpoiler: a.mimeType !== GIF_MIME_TYPE ? true : undefined, + shouldSendAsSpoiler: true, }))); }); @@ -424,8 +423,7 @@ const AttachmentModal: FC = ({ const hasAnySpoilerable = useMemo(() => { if (!renderingAttachments) return false; - return renderingAttachments.some((a) => a.mimeType !== GIF_MIME_TYPE - && !SUPPORTED_AUDIO_CONTENT_TYPES.has(a.mimeType)); + return renderingAttachments.some((a) => !SUPPORTED_AUDIO_CONTENT_TYPES.has(a.mimeType)); }, [renderingAttachments]); if (!renderingAttachments) { diff --git a/src/components/middle/composer/AttachmentModalItem.tsx b/src/components/middle/composer/AttachmentModalItem.tsx index e096532ad..2928315f1 100644 --- a/src/components/middle/composer/AttachmentModalItem.tsx +++ b/src/components/middle/composer/AttachmentModalItem.tsx @@ -3,7 +3,7 @@ import React, { memo, useMemo } from '../../../lib/teact/teact'; import type { ApiAttachment } from '../../../api/types'; -import { GIF_MIME_TYPE, SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES } from '../../../config'; +import { SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES } from '../../../config'; import buildClassName from '../../../util/buildClassName'; import { formatMediaDuration } from '../../../util/dateFormat'; import { getFileExtension } from '../../common/helpers/documentInfo'; @@ -95,9 +95,7 @@ const AttachmentModalItem: FC = ({ }, [attachment, displayType, index, onDelete]); const shouldSkipGrouping = displayType === 'file' || !shouldDisplayGrouped; - const canDisplaySpoilerButton = attachment.mimeType !== GIF_MIME_TYPE; - const shouldDisplaySpoiler = Boolean(displayType !== 'file' && canDisplaySpoilerButton - && attachment.shouldSendAsSpoiler); + const shouldDisplaySpoiler = Boolean(displayType !== 'file' && attachment.shouldSendAsSpoiler); const shouldRenderOverlay = displayType !== 'file'; const rootClassName = buildClassName( @@ -115,16 +113,14 @@ const AttachmentModalItem: FC = ({ /> {shouldRenderOverlay && (
- {canDisplaySpoilerButton && ( - - )} + {onDelete && (