|
|
|
@ -168,18 +168,16 @@ struct TournamentRankView: View { |
|
|
|
VStack(spacing: 0) { |
|
|
|
VStack(spacing: 0) { |
|
|
|
if editMode?.wrappedValue.isEditing == true { |
|
|
|
if editMode?.wrappedValue.isEditing == true { |
|
|
|
if key > 1 { |
|
|
|
if key > 1 { |
|
|
|
Button { |
|
|
|
FooterButtonView("monter") { |
|
|
|
key -= 1 |
|
|
|
key -= 1 |
|
|
|
team.finalRanking = key |
|
|
|
team.finalRanking = key |
|
|
|
|
|
|
|
team.pointsEarned = tournament.isAnimation() ? nil : tournament.tournamentLevel.points(for: key - 1, count: tournament.teamCount) |
|
|
|
do { |
|
|
|
do { |
|
|
|
try self.tournament.tournamentStore.teamRegistrations.addOrUpdate(instance: team) |
|
|
|
try self.tournament.tournamentStore.teamRegistrations.addOrUpdate(instance: team) |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
Logger.error(error) |
|
|
|
Logger.error(error) |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
|
|
|
|
Label("descendre", systemImage: "chevron.compact.up").labelStyle(.iconOnly) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.buttonStyle(.bordered) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -259,18 +257,17 @@ struct TournamentRankView: View { |
|
|
|
.buttonStyle(.plain) |
|
|
|
.buttonStyle(.plain) |
|
|
|
|
|
|
|
|
|
|
|
if editMode?.wrappedValue.isEditing == true { |
|
|
|
if editMode?.wrappedValue.isEditing == true { |
|
|
|
Button { |
|
|
|
FooterButtonView("descendre") { |
|
|
|
key += 1 |
|
|
|
key += 1 |
|
|
|
team.finalRanking = key |
|
|
|
team.finalRanking = key |
|
|
|
|
|
|
|
team.pointsEarned = tournament.isAnimation() ? nil : tournament.tournamentLevel.points(for: key - 1, count: tournament.teamCount) |
|
|
|
|
|
|
|
|
|
|
|
do { |
|
|
|
do { |
|
|
|
try self.tournament.tournamentStore.teamRegistrations.addOrUpdate(instance: team) |
|
|
|
try self.tournament.tournamentStore.teamRegistrations.addOrUpdate(instance: team) |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
Logger.error(error) |
|
|
|
Logger.error(error) |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
|
|
|
|
Label("descendre", systemImage: "chevron.compact.down").labelStyle(.iconOnly) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.buttonStyle(.bordered) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.alert("Position", isPresented: $isEditingTeam) { |
|
|
|
.alert("Position", isPresented: $isEditingTeam) { |
|
|
|
|