From ecf89f6b1daa61642501aecffabbfab773c6e4b7 Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 13 Jan 2025 11:33:33 +0100 Subject: [PATCH] fix group stage scheduling --- PadelClub/Data/MatchScheduler.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PadelClub/Data/MatchScheduler.swift b/PadelClub/Data/MatchScheduler.swift index f45f08f..11865c2 100644 --- a/PadelClub/Data/MatchScheduler.swift +++ b/PadelClub/Data/MatchScheduler.swift @@ -229,14 +229,10 @@ final class MatchScheduler : ModelObject, Storable { return teamsAvailable })) - if rotationIndex > 0 { + if rotationIndex > 0, simultaneousStart == false { rotationMatches = rotationMatches.sorted(by: { if counts[$0.groupStageObject!.index] ?? 0 == counts[$1.groupStageObject!.index] ?? 0 { - if simultaneousStart { - return $0.groupStageObject!.orderedIndexOfMatch($0) < $1.groupStageObject!.orderedIndexOfMatch($1) - } else { - return $0.groupStageObject!.index < $1.groupStageObject!.index - } + return $0.groupStageObject!.index < $1.groupStageObject!.index } else { return counts[$0.groupStageObject!.index] ?? 0 < counts[$1.groupStageObject!.index] ?? 0 }