Skip to content

Commit

Permalink
playbooks rhs participants: fix infinite fetch loop
Browse files Browse the repository at this point in the history
  • Loading branch information
lieut-data committed May 23, 2023
1 parent 8b0ebec commit 6c7cea9
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -56,18 +56,18 @@ export const Participants = ({playbookRun, role, teamName}: Props) => {
};

useEffect(() => {
if (!playbookRun) {
return;
}

const profiles = dispatch(getProfilesByIds(playbookRun.participant_ids));

//@ts-ignore
profiles.then(({data}: { data: UserProfile[] }) => {
// getProfilesByIds doesn't return current user profile, so add it when a user is participant
if (role === Role.Participant) {
data.push(myUser);
}
data.sort(sortByUsername);
setParticipantsProfiles(data || []);
});
}, [dispatch, myUser, playbookRun.participant_ids, role]);
}, [dispatch, playbookRun, playbookRun.participant_ids, role]);

const includesTerm = (user: UserProfile) => {
const userInfo = user.first_name + ';' + user.last_name + ';' + user.nickname + ';' + user.username;
Expand Down

0 comments on commit 6c7cea9

Please sign in to comment.