Skip to content

Commit

Permalink
Combined map and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Samueljh1 committed Oct 11, 2023
1 parent d83a829 commit 7254e5a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,13 @@ function WorkspaceInvitePage(props) {

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

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

_.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 7254e5a

Please sign in to comment.