diff --git a/PadelClub.xcodeproj/project.pbxproj b/PadelClub.xcodeproj/project.pbxproj index ebd7568..8567f6e 100644 --- a/PadelClub.xcodeproj/project.pbxproj +++ b/PadelClub.xcodeproj/project.pbxproj @@ -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; diff --git a/PadelClub/Views/Components/FortuneWheelView.swift b/PadelClub/Views/Components/FortuneWheelView.swift index e29fbd5..6732b18 100644 --- a/PadelClub/Views/Components/FortuneWheelView.swift +++ b/PadelClub/Views/Components/FortuneWheelView.swift @@ -157,6 +157,7 @@ struct SpinDrawView: View { ToolbarItem(placement: .status) { Text("Tous les tirages sont terminés") + .frame(maxWidth: .infinity) } } } diff --git a/PadelClub/Views/Score/SetInputView.swift b/PadelClub/Views/Score/SetInputView.swift index 4a2a5e3..6b9c4b9 100644 --- a/PadelClub/Views/Score/SetInputView.swift +++ b/PadelClub/Views/Score/SetInputView.swift @@ -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 { - otherTeamValueBinding.wrappedValue = 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 { diff --git a/PadelClub/Views/Tournament/Screen/TableStructureView.swift b/PadelClub/Views/Tournament/Screen/TableStructureView.swift index 4444119..bb9e9a7 100644 --- a/PadelClub/Views/Tournament/Screen/TableStructureView.swift +++ b/PadelClub/Views/Tournament/Screen/TableStructureView.swift @@ -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 {