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
|
@ -2,14 +2,14 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { AttachmentType } from '../types/Attachment';
|
||||
import { getUploadSizeLimitKb } from '../types/Attachment';
|
||||
import { getMaximumAttachmentSize } from '../types/Attachment';
|
||||
import { showToast } from './showToast';
|
||||
import { ToastFileSize } from '../components/ToastFileSize';
|
||||
|
||||
export function isAttachmentSizeOkay(
|
||||
attachment: Readonly<AttachmentType>
|
||||
): boolean {
|
||||
const limitKb = getUploadSizeLimitKb(attachment.contentType);
|
||||
const limitKb = getMaximumAttachmentSize();
|
||||
// this needs to be cast properly
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue