Skip to content

Commit b0e722c

Browse files
authored
Merge branch 'develop' into bugfix-2674/require-skill-for-skills-report
2 parents 82c315a + 10f478a commit b0e722c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

web-ui/src/pages/EmailPage.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,18 @@ const ComposeEmailStep = ({
185185
const fileReader = new FileReader();
186186
fileReader.onload = e => {
187187
const mjmlContent = e.target.result.toString();
188-
const { html } = mjml2html(mjmlContent);
189-
onEmailContentsChange(html);
188+
try {
189+
const result = mjml2html(mjmlContent);
190+
onEmailContentsChange(result.html);
191+
} catch(e) {
192+
window.snackDispatch({
193+
type: UPDATE_TOAST,
194+
payload: {
195+
severity: 'error',
196+
toast: e.message,
197+
}
198+
});
199+
}
190200
};
191201

192202
const file = event.target.files[0];

0 commit comments

Comments
 (0)