|
|
|
|
@ -18,6 +18,7 @@ struct TournamentCellView: View { |
|
|
|
|
var displayStyle: DisplayStyle = .wide |
|
|
|
|
var displayContext: DisplayContext = .edition |
|
|
|
|
@State var shouldTournamentBeOver: Bool = false |
|
|
|
|
@State private var inProgressBuild: (String, any TournamentBuildHolder)? = nil |
|
|
|
|
|
|
|
|
|
var event: Event? { |
|
|
|
|
guard let federalTournament = tournament as? FederalTournament else { return nil } |
|
|
|
|
@ -144,6 +145,10 @@ struct TournamentCellView: View { |
|
|
|
|
Text(teamCount.formatted()) |
|
|
|
|
} |
|
|
|
|
} else if let federalTournament = tournament as? FederalTournament, navigation.agendaDestination != .around { |
|
|
|
|
|
|
|
|
|
if let inProgressBuild, build.age == inProgressBuild.1.age, build.level == inProgressBuild.1.level, build.category == inProgressBuild.1.category, inProgressBuild.0 == federalTournament.id { |
|
|
|
|
ProgressView() |
|
|
|
|
} else { |
|
|
|
|
Button { |
|
|
|
|
_createOrShow(federalTournament: federalTournament, existingTournament: existingTournament, build: build) |
|
|
|
|
} label: { |
|
|
|
|
@ -156,6 +161,7 @@ struct TournamentCellView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.font(displayStyle == .wide ? .title : .title3) |
|
|
|
|
|
|
|
|
|
if displayStyle == .wide { |
|
|
|
|
@ -221,6 +227,8 @@ struct TournamentCellView: View { |
|
|
|
|
newTournament.umpireCustomMail = federalTournament.mailLabel() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inProgressBuild = (federalTournament.id, build) |
|
|
|
|
|
|
|
|
|
Task { |
|
|
|
|
do { |
|
|
|
|
let umpireData = try await NetworkFederalService.shared.getUmpireData(idTournament: federalTournament.id) |
|
|
|
|
@ -240,6 +248,10 @@ struct TournamentCellView: View { |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await MainActor.run { |
|
|
|
|
inProgressBuild = nil |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|