Skip to content

Commit

Permalink
Merge pull request Expensify#33742 from bernhardoj/fix/32682-invite-m…
Browse files Browse the repository at this point in the history
…ember

Fix can't add member if login while focus mode is on
  • Loading branch information
deetergp authored Jan 2, 2024
2 parents ff13beb + 8188315 commit bab1a1d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ function buildAnnounceRoomMembersOnyxData(policyID, accountIDs) {
onyxFailureData: [],
};

if (!announceReport) {
return announceRoomMembers;
}

announceRoomMembers.onyxOptimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${announceReport.reportID}`,
Expand Down Expand Up @@ -301,6 +305,10 @@ function removeOptimisticAnnounceRoomMembers(policyID, accountIDs) {
onyxFailureData: [],
};

if (!announceReport) {
return announceRoomMembers;
}

const remainUsers = _.difference(announceReport.participantAccountIDs, accountIDs);
announceRoomMembers.onyxOptimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
Expand Down

0 comments on commit bab1a1d

Please sign in to comment.