IO-1937 Add 10mb limit for emails.

This commit is contained in:
Patrick Fic
2022-06-17 15:22:29 -07:00
parent 7ba3cc5ffa
commit 1e88d5ae1b
13 changed files with 15461 additions and 3334 deletions

View File

@@ -38,6 +38,12 @@ export function EmailDocumentsComponent({
nextFetchPolicy: "network-only",
});
console.log(
selectedMedia &&
selectedMedia
.filter((s) => s.isSelected)
.reduce((acc, val) => (acc = acc + val.size), 0)
);
return (
<div>
{loading && <LoadingSpinner />}
@@ -45,6 +51,12 @@ export function EmailDocumentsComponent({
{selectedMedia.filter((s) => s.isSelected).length >= 10 ? (
<div style={{ color: "red" }}>{t("messaging.labels.maxtenimages")}</div>
) : null}
{selectedMedia &&
selectedMedia
.filter((s) => s.isSelected)
.reduce((acc, val) => (acc = acc + val.size), 0) >= 9961472 ? (
<div style={{ color: "red" }}>{t("general.errors.sizelimit")}</div>
) : null}
{data && (
<JobDocumentsGalleryExternal
data={data ? data.documents : []}