Skip to content

Commit

Permalink
fix: Export messages additional emails not being validated (#34092)
Browse files Browse the repository at this point in the history
Co-authored-by: gabriellsh <[email protected]>
  • Loading branch information
dougfabris and gabriellsh authored Dec 3, 2024
1 parent 486b33a commit 6989231
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-fishes-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fixes mail export form "To additional emails" field validation
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,8 @@ const MailExportForm = ({ formId, rid, onCancel, exportOptions }: MailExportForm
rules={{
validate: {
validateEmail: (additionalEmails) => {
if (additionalEmails === '') {
return undefined;
}

if (additionalEmails !== '' && validateEmail(additionalEmails)) {
const emails = additionalEmails?.split(',').map((email) => email.trim());
if (Array.isArray(emails) && emails.every((email) => validateEmail(email.trim()))) {
return undefined;
}

Expand Down

0 comments on commit 6989231

Please sign in to comment.