Support for server-configurable maximum attachment size

This commit is contained in:
Scott Nonnenberg 2022-04-13 10:47:39 -07:00 committed by GitHub
parent 677548f3a3
commit 37c44fb631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 38 deletions

View file

@ -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