fix issue with structure reset
main
Razmig Sarkissian 2 weeks ago
parent 57945f6cfd
commit 00d759dd6c
  1. 4
      PadelClub.xcodeproj/project.pbxproj
  2. 1
      PadelClub/Views/Components/FortuneWheelView.swift
  3. 4
      PadelClub/Views/Score/SetInputView.swift
  4. 12
      PadelClub/Views/Tournament/Screen/TableStructureView.swift

@ -3245,7 +3245,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
@ -3293,7 +3293,7 @@
CODE_SIGN_ENTITLEMENTS = PadelClub/PadelClub.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEFINES_MODULE = YES;
DEVELOPMENT_ASSET_PATHS = "\"PadelClub/Preview Content\"";
DEVELOPMENT_TEAM = BQ3Y44M3Q6;

@ -157,6 +157,7 @@ struct SpinDrawView: View {
ToolbarItem(placement: .status) {
Text("Tous les tirages sont terminés")
.frame(maxWidth: .infinity)
}
}
}

@ -234,7 +234,11 @@ struct SetInputView: View {
} else if newValue == setFormat.scoreToWin - 2 && setFormat.tieBreak == 8 {
otherTeamValueBinding.wrappedValue = setFormat.scoreToWin
} else if newValue == setFormat.scoreToWin - 1 {
if setFormat == .three {
otherTeamValueBinding.wrappedValue = setFormat.scoreToWin
} else {
otherTeamValueBinding.wrappedValue = setFormat.scoreToWin + 1
}
} else if newValue <= setFormat.scoreToWin - 2 {
otherTeamValueBinding.wrappedValue = setFormat.scoreToWin
} else if newValue > 10 && setFormat == .superTieBreak {

@ -124,7 +124,7 @@ struct TableStructureView: View {
Section {
LabeledContent {
StepperView(count: $teamCount, minimum: 4, maximum: 128) {
StepperView(count: $teamCount, minimum: 2, maximum: 128) {
} submitFollowUpAction: {
_verifyValueIntegrity()
@ -536,6 +536,7 @@ struct TableStructureView: View {
}
private func _reset() {
let tc = tournament.teamCount
tournament.unsortedTeams().forEach {
$0.resetPositions()
}
@ -549,7 +550,8 @@ struct TableStructureView: View {
_updatePreset()
}
tournament.teamCount = teamCount
teamCount = tc
tournament.teamCount = tc
tournament.groupStageCount = groupStageCount
tournament.teamsPerGroupStage = teamsPerGroupStage
tournament.qualifiedPerGroupStage = qualifiedPerGroupStage
@ -598,7 +600,7 @@ struct TableStructureView: View {
private func _save(rebuildEverything: Bool = false) async {
_verifyValueIntegrity()
let tc = tournament.teamCount
do {
let requirements = Set(updatedElements.compactMap { $0.requiresRebuilding })
@ -774,8 +776,8 @@ struct TableStructureView: View {
groupStageCount = maxGroupStages
}
if teamCount < 4 {
teamCount = 4
if teamCount < 2 {
teamCount = 2
}
if groupStageCount < 0 {

Loading…
Cancel
Save