Skip to content

Commit

Permalink
chore: refactor sorting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yumincho committed May 22, 2024
1 parent 06beda0 commit 863441f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/web/src/components/organisms/AgendaSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ export const AgendaSection: React.FC = () => {
(agendaStatus: AgendaStatus) => {
if (agendaStatus === "preparing") return preparingAgendas;
if (agendaStatus === "ongoing")
return ongoingAgendas.sort((a, b) => {
if (a.voters.voted === 0) return -1;
if (b.voters.voted === 0) return 1;
return 0;
});
return ongoingAgendas.sort((a, b) => a.voters.voted - b.voters.voted);

if (agendaStatus === "terminated") {
const recent24Hours = new Date();
recent24Hours.setDate(new Date().getDate() - 1);
Expand Down

0 comments on commit 863441f

Please sign in to comment.