Message: Fix upload .webp file (#4566)
This commit is contained in:
parent
1b3871fb34
commit
8051e27b23
@ -4,7 +4,7 @@ import { getActions } from '../../../global';
|
|||||||
|
|
||||||
import type { ApiMessage } from '../../../api/types';
|
import type { ApiMessage } from '../../../api/types';
|
||||||
|
|
||||||
import { canReplaceMessageMedia, isUploadingFileSticker } from '../../../global/helpers';
|
import { canReplaceMessageMedia } from '../../../global/helpers';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import captureEscKeyListener from '../../../util/captureEscKeyListener';
|
import captureEscKeyListener from '../../../util/captureEscKeyListener';
|
||||||
import buildAttachment from './helpers/buildAttachment';
|
import buildAttachment from './helpers/buildAttachment';
|
||||||
@ -59,9 +59,8 @@ const DropArea: FC<OwnProps> = ({
|
|||||||
const folderFiles = await getFilesFromDataTransferItems(dt.items);
|
const folderFiles = await getFilesFromDataTransferItems(dt.items);
|
||||||
const newAttachment = folderFiles && await buildAttachment(folderFiles[0].name, folderFiles[0]);
|
const newAttachment = folderFiles && await buildAttachment(folderFiles[0].name, folderFiles[0]);
|
||||||
const canReplace = editingMessage && newAttachment && canReplaceMessageMedia(editingMessage, newAttachment);
|
const canReplace = editingMessage && newAttachment && canReplaceMessageMedia(editingMessage, newAttachment);
|
||||||
const isFileSticker = newAttachment && isUploadingFileSticker(newAttachment);
|
|
||||||
|
|
||||||
if (canReplace || isFileSticker) {
|
if (canReplace) {
|
||||||
showNotification({ message: lang(isInAlbum ? 'lng_edit_media_album_error' : 'lng_edit_media_invalid_file') });
|
showNotification({ message: lang(isInAlbum ? 'lng_edit_media_album_error' : 'lng_edit_media_invalid_file') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user