Skip to content

Commit

Permalink
#58 revert sorting of users, so that own user is always first. curren…
Browse files Browse the repository at this point in the history
…tly avatars are chosen by client, in order...
  • Loading branch information
xeronimus@gmail.com authored and xeronimus@gmail.com committed Jun 21, 2020
1 parent 1d98ace commit dd36294
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions client/app/components/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import User from './User';
/**
* The list of users (avatars) and their estimations.
*/
const Users = ({users, ownUserId}) => {
const Users = ({users}) => {
const userArray = Object.values(users);
userArray.sort((uOne, uTwo) => (uOne.id === ownUserId ? -1 : uTwo.id === ownUserId ? 1 : 0));

return (
<div className="users">
Expand All @@ -21,11 +20,9 @@ const Users = ({users, ownUserId}) => {
};

Users.propTypes = {
users: PropTypes.object,
ownUserId: PropTypes.string
users: PropTypes.object
};

export default connect((state) => ({
users: state.users,
ownUserId: state.userId
users: state.users
}))(Users);

0 comments on commit dd36294

Please sign in to comment.