Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Jun 24, 2024
1 parent e8a045c commit 9f57a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class EmbeddedCoverageFormComponent extends React.PureComponent<IProps, I
};

if ((this.props.coverage.language ?? '').length < 1) {
updates.language = newDesk?.desk_language;
updates.language = newDesk?.desk_language ?? null;
}

this.setState({
Expand Down
3 changes: 2 additions & 1 deletion client/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@ export const getItemsById = (ids, items) => (
export const getUsersForDesk = (desk, globalUserList = []) => {
if (!desk) return globalUserList;

return globalUserList.filter(({_id}) => (desk.members ?? []).find((member) => member.user === _id));
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 9f57a95

Please sign in to comment.