Skip to content

Commit

Permalink
Merge pull request #2639 from objectcomputing/bugfix-2636/removed-use…
Browse files Browse the repository at this point in the history
…r-remains

#2636 - Avoid overwriting the list of team members, if we already have a list.
  • Loading branch information
mkimberlin authored Oct 17, 2024
2 parents 1a5acfe + 13953b9 commit bee5d29
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web-ui/src/components/reviews/TeamReviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ const TeamReviews = ({ onBack, periodId }) => {
};

const loadTeamMembers = () => {
let members = [];
// If we already have a list of team members, we should not overwrite the
// list with the original list of team members.
if (teamMembers.length > 0) {
return;
}

let source;
if (!approvalMode || (isAdmin && showAll)) {
Expand All @@ -226,8 +230,7 @@ const TeamReviews = ({ onBack, periodId }) => {
// Always filter the members down to existing selected assignments.
// We do not want to add members that were not already selected.
const memberIds = assignments.map(a => a.revieweeId);
members = source.filter(m => memberIds.includes(m.id));

let members = source.filter(m => memberIds.includes(m.id));
setTeamMembers(members);
};

Expand Down

0 comments on commit bee5d29

Please sign in to comment.