feature/IO-3499-React-19: Manual Appointment in Schedule, Email Form console error
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user