ducks/composer: Properly compare attachment size against limit
This commit is contained in:
parent
74abe0c1ef
commit
aa1f96cb6a
1 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@ import {
|
||||||
resetLinkPreview,
|
resetLinkPreview,
|
||||||
suspendLinkPreviews,
|
suspendLinkPreviews,
|
||||||
} from '../../services/LinkPreview';
|
} from '../../services/LinkPreview';
|
||||||
import { getMaximumAttachmentSizeInKb } from '../../util/attachments';
|
import { getMaximumAttachmentSizeInKb, KIBIBYTE } from '../../util/attachments';
|
||||||
import { getRecipientsByConversation } from '../../util/getRecipientsByConversation';
|
import { getRecipientsByConversation } from '../../util/getRecipientsByConversation';
|
||||||
import {
|
import {
|
||||||
getRenderDetailsForLimit,
|
getRenderDetailsForLimit,
|
||||||
|
@ -901,7 +901,7 @@ function preProcessAttachment(
|
||||||
}
|
}
|
||||||
|
|
||||||
const limitKb = getMaximumAttachmentSizeInKb();
|
const limitKb = getMaximumAttachmentSizeInKb();
|
||||||
if (file.size > limitKb) {
|
if (file.size / KIBIBYTE > limitKb) {
|
||||||
return {
|
return {
|
||||||
toastType: ToastType.FileSize,
|
toastType: ToastType.FileSize,
|
||||||
parameters: getRenderDetailsForLimit(limitKb),
|
parameters: getRenderDetailsForLimit(limitKb),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue