Skip to content

Commit

Permalink
Increased strictness of email parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Samueljh1 committed Oct 11, 2023
1 parent de0e9d6 commit d83a829
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,18 @@ function WorkspaceInvitePage(props) {
const excludedUsers = useMemo(() => PolicyUtils.getIneligibleInvitees(props.policyMembers, props.personalDetails), [props.policyMembers, props.personalDetails]);

useEffect(() => {
let emails = searchTerm.replace(/,\s/g, ',').split(',');
let emails = searchTerm.replace(/\s,\s/g, ',').split(',');
emails = _.map(emails, word => word.trim());

const newUsersToInviteDict = {};
const newPersonalDetailsDict = {};
const newSelectedOptionsDict = {};

emails.forEach((email) => {

_.forEach(emails, (email) => {
if (email === '') {
return;
}

const inviteOptions = OptionsListUtils.getMemberInviteOptions(props.personalDetails, props.betas, email, excludedUsers);

// Update selectedOptions with the latest personalDetails and policyMembers information
Expand Down

0 comments on commit d83a829

Please sign in to comment.