Skip to content

Commit

Permalink
change method update selectedEmplyees
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed May 15, 2023
1 parent fbdc927 commit 20ae498
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ class WorkspaceMembersPage extends React.Component {
}

if (prevProps.policyMemberList !== this.props.policyMemberList) {
this.setState((prevState) => {
const selectedEmployees = _.filter(prevState.selectedEmployees, (selectedEmployee) => _.has(this.props.policyMemberList, selectedEmployee));
return {
selectedEmployees,
};
});
this.setState((prevState) => ({
selectedEmployees: _.intersection(prevState.selectedEmployees, _.keys(this.props.policyMemberList)),
}));
}

const isReconnecting = prevProps.network.isOffline && !this.props.network.isOffline;
Expand Down

0 comments on commit 20ae498

Please sign in to comment.