Skip to content

Commit df143d9

Browse files
committed
Add all invitees to the workspace on mention whisper confirmation
1 parent 42852d3 commit df143d9

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4371,15 +4371,16 @@ function resolveActionableMentionWhisper(
43714371
const welcomeNoteSubject = `# ${currentUserDetails?.displayName ?? ''} invited you to ${policy?.name ?? 'a workspace'}`;
43724372
const welcomeNote = Localize.translateLocal('workspace.common.welcomeNote');
43734373
const policyMemberAccountIDs = Object.values(getMemberAccountIDsForWorkspace(policy?.employeeList, false, false));
4374-
addMembersToWorkspace(
4375-
{
4376-
[`${actionOriginalMessage.inviteeEmails?.at(0)}`]: actionOriginalMessage.inviteeAccountIDs?.at(0) ?? CONST.DEFAULT_NUMBER_ID,
4377-
},
4378-
`${welcomeNoteSubject}\n\n${welcomeNote}`,
4379-
policyID,
4380-
policyMemberAccountIDs,
4381-
CONST.POLICY.ROLE.USER,
4382-
);
4374+
4375+
const invitees: Record<string, number> = {};
4376+
actionOriginalMessage.inviteeEmails?.forEach((email, index) => {
4377+
if (!email) {
4378+
return;
4379+
}
4380+
invitees[email] = actionOriginalMessage.inviteeAccountIDs?.at(index) ?? CONST.DEFAULT_NUMBER_ID;
4381+
});
4382+
4383+
addMembersToWorkspace(invitees, `${welcomeNoteSubject}\n\n${welcomeNote}`, policyID, policyMemberAccountIDs, CONST.POLICY.ROLE.USER);
43834384
}
43844385
}
43854386

0 commit comments

Comments
 (0)