feature/IO-3499-React-19: Manual Appointment in Schedule, Email Form console error

This commit is contained in:
Dave
2026-01-19 14:30:11 -05:00
parent 7a0187afbe
commit 89622f0af2
2 changed files with 50 additions and 36 deletions

View File

@@ -32,6 +32,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
const [loading, setLoading] = useState(false);
const [sending, setSending] = useState(false);
const [rawHtml, setRawHtml] = useState("");
const [htmlSize, setHtmlSize] = useState(0);
const [pdfCopytoAttach, setPdfCopytoAttach] = useState({
filename: null,
pdf: null
@@ -151,6 +152,13 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
if (modalVisible) render();
}, [modalVisible]);
useEffect(() => {
const html = form.getFieldValue("html");
if (html) {
setHtmlSize(new Blob([html]).size);
}
}, [form, rawHtml]);
return (
<Modal
destroyOnHidden
@@ -169,7 +177,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
disabled:
selectedMedia &&
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
10485760 - new Blob([form.getFieldValue("html")]).size ||
10485760 - htmlSize ||
selectedMedia.filter((s) => s.isSelected).length > 10)
}}
>
@@ -195,7 +203,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
disabled={
selectedMedia &&
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
10485760 - new Blob([form.getFieldValue("html")]).size ||
10485760 - htmlSize ||
selectedMedia.filter((s) => s.isSelected).length > 10)
}
type="primary"