Skip to content

Commit

Permalink
Final commit for review
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Rublov <airublev@outlook.com>
  • Loading branch information
Andrii Rublov authored and arublov committed Feb 21, 2024
1 parent 70a8ea9 commit f9da4ce
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1217,21 +1217,16 @@ export default {
this.onNewAddr(option, this.selectBcc)
},
onNewAddr(option, list) {
//@todo condition if it is not a contact
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
const delimiterRegex = /;|,/
const addresses = option.email.trim().split(delimiterRegex).filter(email => emailRegex.test(email))
const addresses = option.email.trim().split(delimiterRegex)
addresses.forEach(email => {
if (list.some((recipient) => recipient.email === email)) {
return
}
const t = {label: email, email: email}
const recipient = { ...t }
const recipient = { ...{label: email, email: email} }
this.newRecipients.push(recipient)
list.push(recipient)
this.saveDraftDebounced()
Expand Down

0 comments on commit f9da4ce

Please sign in to comment.