Skip to content

Commit

Permalink
fix: sort by value
Browse files Browse the repository at this point in the history
  • Loading branch information
psykzz authored Oct 1, 2024
1 parent d04ded2 commit 17b1e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/UserList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const UserList = ({ me, users, scores }) => {
users?.sort((a, b) => a.id.localeCompare(b.id));
try {
// Try to sort by score as well.
users?.sort((a,b) => (scoreByUser?.[a.id] ?? 0) > (scoreByUser?.[b.id] ?? 0));
users?.sort((a,b) => (scoreByUser[a.id]?.score ?? 0) - (scoreByUser[b.id]?.score ?? 0));
} catch (e) { console.error(e); }
console.log({users})

Expand Down

0 comments on commit 17b1e02

Please sign in to comment.