fix default match format

fix default tournament configuration view
club_update
Razmig Sarkissian 1 year ago
parent 5f7039fa1c
commit 4c4c7b8489
  1. 4
      PadelClub/Data/Tournament.swift
  2. 7
      PadelClub/Views/Cashier/Event/TournamentConfiguratorView.swift

@ -1827,8 +1827,8 @@ defer {
func setupFederalSettings() {
teamSorting = tournamentLevel.defaultTeamSortingType
groupStageMatchFormat = groupStageSmartMatchFormat()
loserBracketMatchFormat = loserBracketSmartMatchFormat(1)
matchFormat = roundSmartMatchFormat(1)
loserBracketMatchFormat = loserBracketSmartMatchFormat(5)
matchFormat = roundSmartMatchFormat(5)
}
func roundSmartMatchFormat(_ roundIndex: Int) -> MatchFormat {

@ -29,6 +29,13 @@ struct TournamentConfigurationView: View {
if tournament.federalLevelCategory == .unlisted {
tournament.federalCategory = .unlisted
tournament.federalAgeCategory = .unlisted
} else {
if tournament.federalCategory == .unlisted {
tournament.federalCategory = .men
}
if tournament.federalAgeCategory == .unlisted {
tournament.federalAgeCategory = .senior
}
}
}
Picker(selection: $tournament.federalCategory, label: Text("Catégorie")) {

Loading…
Cancel
Save