|
|
|
|
@ -55,7 +55,7 @@ struct GroupStagesView: View { |
|
|
|
|
|
|
|
|
|
init(tournament: Tournament) { |
|
|
|
|
self.tournament = tournament |
|
|
|
|
self.allMatches = tournament.groupStages().flatMap({ $0.playedMatches() }) |
|
|
|
|
self.allMatches = tournament.groupStagesMatches() |
|
|
|
|
|
|
|
|
|
if tournament.shouldVerifyGroupStage { |
|
|
|
|
_selectedDestination = State(wrappedValue: nil) |
|
|
|
|
@ -81,14 +81,14 @@ struct GroupStagesView: View { |
|
|
|
|
GenericDestinationPickerView(selectedDestination: $selectedDestination, destinations: allDestinations(), nilDestinationIsValid: true) |
|
|
|
|
switch selectedDestination { |
|
|
|
|
case .all: |
|
|
|
|
let availableToStart = tournament.availableToStart(allMatches) |
|
|
|
|
let runningMatches = tournament.runningMatches(allMatches) |
|
|
|
|
let availableToStart = tournament.availableToStart(allMatches, in: runningMatches) |
|
|
|
|
let readyMatches = tournament.readyMatches(allMatches) |
|
|
|
|
let finishedMatches = tournament.finishedMatches(allMatches) |
|
|
|
|
|
|
|
|
|
List { |
|
|
|
|
MatchListView(section: "disponible", matches: availableToStart, matchViewStyle: .standardStyle, isExpanded: false) |
|
|
|
|
MatchListView(section: "en cours", matches: runningMatches, matchViewStyle: .standardStyle, isExpanded: false) |
|
|
|
|
MatchListView(section: "disponible", matches: availableToStart, matchViewStyle: .standardStyle, isExpanded: false) |
|
|
|
|
MatchListView(section: "à lancer", matches: readyMatches, matchViewStyle: .standardStyle, isExpanded: false) |
|
|
|
|
MatchListView(section: "terminés", matches: finishedMatches, matchViewStyle: .standardStyle, isExpanded: false) |
|
|
|
|
} |
|
|
|
|
|