diff --git a/lib/wca_live/scoretaking.ex b/lib/wca_live/scoretaking.ex index 11b663d5..b747460f 100644 --- a/lib/wca_live/scoretaking.ex +++ b/lib/wca_live/scoretaking.ex @@ -580,7 +580,9 @@ defmodule WcaLive.Scoretaking do |> Repo.all() |> Repo.preload(rounds: :results) - Enum.map(competition_events, fn competition_event -> + competition_events + |> Enum.sort_by(&Event.get_rank_by_id!(&1.event_id)) + |> Enum.map(fn competition_event -> final_round = Enum.max_by(competition_event.rounds, & &1.number) podium_results =