sync
Raz 8 months ago
parent faa9cd8182
commit 7721302377
  1. 4
      PadelClub.xcodeproj/project.pbxproj
  2. 6
      PadelClub/Data/Round.swift
  3. 4
      PadelClub/Data/Tournament.swift
  4. 7
      PadelClub/Views/Team/Components/TeamWeightView.swift
  5. 5
      PadelClub/Views/Team/TeamPickerView.swift

@ -3344,7 +3344,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.24; MARKETING_VERSION = 1.1.25;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3389,7 +3389,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1.24; MARKETING_VERSION = 1.1.25;
PRODUCT_BUNDLE_IDENTIFIER = app.padelclub; PRODUCT_BUNDLE_IDENTIFIER = app.padelclub;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -650,9 +650,9 @@ defer {
let roundCount = RoundRule.numberOfRounds(forTeams: currentRoundMatchCount) let roundCount = RoundRule.numberOfRounds(forTeams: currentRoundMatchCount)
var loserBracketMatchFormat = tournamentObject()?.loserBracketMatchFormat var loserBracketMatchFormat = tournamentObject()?.loserBracketMatchFormat
if let parentRound { // if let parentRound {
loserBracketMatchFormat = tournamentObject()?.loserBracketSmartMatchFormat(parentRound.index) // loserBracketMatchFormat = tournamentObject()?.loserBracketSmartMatchFormat(parentRound.index)
} // }
let rounds = (0..<roundCount).map { //index 0 is the final let rounds = (0..<roundCount).map { //index 0 is the final
let round = Round(tournament: tournament, index: $0, matchFormat: loserBracketMatchFormat) let round = Round(tournament: tournament, index: $0, matchFormat: loserBracketMatchFormat)

@ -1931,7 +1931,7 @@ defer {
var _groupStages = [GroupStage]() var _groupStages = [GroupStage]()
for index in 0..<groupStageCount { for index in 0..<groupStageCount {
let groupStage = GroupStage(tournament: id, index: index, size: teamsPerGroupStage, matchFormat: groupStageSmartMatchFormat()) let groupStage = GroupStage(tournament: id, index: index, size: teamsPerGroupStage, matchFormat: groupStageFormat)
_groupStages.append(groupStage) _groupStages.append(groupStage)
} }
@ -1956,7 +1956,7 @@ defer {
let rounds = (0..<roundCount).map { //index 0 is the final let rounds = (0..<roundCount).map { //index 0 is the final
return Round(tournament: id, index: $0, matchFormat: roundSmartMatchFormat($0), loserBracketMode: loserBracketMode) return Round(tournament: id, index: $0, matchFormat: matchFormat, loserBracketMode: loserBracketMode)
} }
if rounds.isEmpty { if rounds.isEmpty {

@ -11,9 +11,14 @@ struct TeamWeightView: View {
@EnvironmentObject var dataStore: DataStore @EnvironmentObject var dataStore: DataStore
let team: TeamRegistration let team: TeamRegistration
var teamPosition: TeamPosition? = nil var teamPosition: TeamPosition? = nil
var teamIndex: Int? var teamIndex: Int?
init(team: TeamRegistration, teamPosition: TeamPosition? = nil, teamIndex: Int? = nil) {
self.team = team
self.teamPosition = teamPosition
self.teamIndex = teamIndex ?? team.tournamentObject()?.indexOf(team: team)
}
var displayWeight: Bool { var displayWeight: Bool {
team.shouldDisplayRankAndWeight() && team.tournamentObject()?.hideWeight() == false team.shouldDisplayRankAndWeight() && team.tournamentObject()?.hideWeight() == false
} }

@ -121,7 +121,9 @@ struct TeamPickerView: View {
} }
} }
@ViewBuilder
private func _teamListView(_ teams: [TeamRegistration]) -> some View { private func _teamListView(_ teams: [TeamRegistration]) -> some View {
let selectedSortedTeams = tournament.selectedSortedTeams()
ForEach(teams) { team in ForEach(teams) { team in
if searchField.isEmpty || team.contains(searchField) { if searchField.isEmpty || team.contains(searchField) {
Button { Button {
@ -134,7 +136,8 @@ struct TeamPickerView: View {
// presentTeamPickerView = false // presentTeamPickerView = false
// } // }
} label: { } label: {
TeamRowView(team: team) let teamIndex = team.index(in: selectedSortedTeams)
TeamRowView(team: team, teamIndex: teamIndex)
.environment(\.isEditingTournamentSeed, .constant(false)) .environment(\.isEditingTournamentSeed, .constant(false))
.contentShape(Rectangle()) .contentShape(Rectangle())
} }

Loading…
Cancel
Save