Message: Fix "No file" error when downloading media (#2001)

This commit is contained in:
Alexander Zinchuk 2022-08-18 16:16:25 +02:00
parent 4b7b72592e
commit 43fa66eb61

View File

@ -317,8 +317,11 @@ export function getMessageMediaFormat(
} = message.content;
const fullVideo = video || getMessageWebPageVideo(message);
const size = (video || audio || document)?.size!;
if (target === 'download' && IS_PROGRESSIVE_SUPPORTED && size > MAX_BUFFER_SIZE && !IS_OPFS_SUPPORTED) {
return ApiMediaFormat.DownloadUrl;
if (target === 'download') {
if (IS_PROGRESSIVE_SUPPORTED && size > MAX_BUFFER_SIZE && !IS_OPFS_SUPPORTED) {
return ApiMediaFormat.DownloadUrl;
}
return ApiMediaFormat.BlobUrl;
}
if (fullVideo && IS_PROGRESSIVE_SUPPORTED && (