Skip to content

Commit

Permalink
Fix homepage popular ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
ethancheez committed Nov 13, 2023
1 parent d4b0312 commit fafb52c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/imports/ui/pages/Homepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const Homepage = () => {
if (model.like === 0 && model.dislike > 0) {
return -1;
}
if (model.dislike === 0) {
return model.like;
}
return model.like / (model.like + model.dislike);
}).reverse().slice(0, 7);

Expand All @@ -51,6 +54,9 @@ const Homepage = () => {
if (thread.likes === 0 && thread.dislikes > 0) {
return -1;
}
if (thread.dislike === 0) {
return thread.like;
}
return thread.likes / (thread.likes + thread.dislikes);
}).reverse().slice(0, 7);

Expand All @@ -61,6 +67,9 @@ const Homepage = () => {
if (sim.like === 0 && sim.dislike > 0) {
return -1;
}
if (sim.dislike === 0) {
return sim.like;
}
return sim.like / (sim.like + sim.dislike);
}).reverse().slice(0, 9);
}
Expand Down

0 comments on commit fafb52c

Please sign in to comment.