Skip to content

Commit

Permalink
backport test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Jul 17, 2024
1 parent 707c077 commit 075797d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,9 @@ export const getItemsById = (ids, items) => (
export const getUsersForDesk = (desk, globalUserList = []) => {
if (!desk) return globalUserList;

return globalUserList.filter((user) =>
map(desk.members, 'user').indexOf(user._id) !== -1);
const deskMembersSet = new Set((desk.members ?? []).map((member) => member.user));

return globalUserList.filter(({_id}) => deskMembersSet.has(_id));
};

export const getDesksForUser = (user, desksList = []) => {
Expand Down

0 comments on commit 075797d

Please sign in to comment.