Support for server-configurable maximum attachment size
This commit is contained in:
parent
677548f3a3
commit
37c44fb631
6 changed files with 23 additions and 38 deletions
|
@ -8,6 +8,7 @@ import type {
|
|||
AttachmentDraftType,
|
||||
InMemoryAttachmentDraftType,
|
||||
} from '../types/Attachment';
|
||||
import { getMaximumAttachmentSize } from '../types/Attachment';
|
||||
import { AttachmentToastType } from '../types/AttachmentToastType';
|
||||
import { fileToBytes } from './fileToBytes';
|
||||
import { handleImageAttachment } from './handleImageAttachment';
|
||||
|
@ -44,8 +45,7 @@ export function preProcessAttachment(
|
|||
return;
|
||||
}
|
||||
|
||||
const MB = 1000 * 1024;
|
||||
if (file.size > 100 * MB) {
|
||||
if (file.size > getMaximumAttachmentSize()) {
|
||||
return AttachmentToastType.ToastFileSize;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue