Skip to content

Commit

Permalink
Merge pull request #15324 from Expensify/workspace-remove-closed-acco…
Browse files Browse the repository at this point in the history
…unts

Make sure closed accounts don't show in workspace members
  • Loading branch information
MonilBhavsar authored Feb 24, 2023
2 parents 2df7f86 + 5cdc116 commit 76f063a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,10 @@ class WorkspaceMembersPage extends React.Component {
*/
getWorkspaceMembers() {
/**
* clientMemberEmails should be filtered to only pass valid members, failure to do so
* will remove all non-existing members that should be displayed (e.g. non-existing members that should display an error).
* This is due to how calling `Onyx::merge` on array fields overwrites the array.
* see https://github.com/Expensify/App/issues/12265#issuecomment-1307889721 for more context
* We filter clientMemberEmails to only pass members without errors
* Otherwise, the members with errors would immediately be removed before the user has a chance to read the error
*/
const clientMemberEmails = _.keys(_.pick(this.props.policyMemberList, member => member.role));
const clientMemberEmails = _.keys(_.pick(this.props.policyMemberList, member => _.isEmpty(member.errors)));
Policy.openWorkspaceMembersPage(this.props.route.params.policyID, clientMemberEmails);
}

Expand Down

0 comments on commit 76f063a

Please sign in to comment.