Skip to content

Commit 13953b9

Browse files
committed
#2636 - Avoid overwriting the list of team members, if we already have a list.
1 parent fc5ee05 commit 13953b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

web-ui/src/components/reviews/TeamReviews.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ const TeamReviews = ({ onBack, periodId }) => {
210210
};
211211

212212
const loadTeamMembers = () => {
213-
let members = [];
213+
// If we already have a list of team members, we should not overwrite the
214+
// list with the original list of team members.
215+
if (teamMembers.length > 0) {
216+
return;
217+
}
214218

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

0 commit comments

Comments
 (0)