|
|
|
|
@ -70,13 +70,13 @@ struct LoserRoundView: View { |
|
|
|
|
if let seedInterval = previousRound.seedInterval(initialMode: isEditingTournamentSeed.wrappedValue == true) { |
|
|
|
|
Text(seedInterval.localizedLabel()) |
|
|
|
|
} else { |
|
|
|
|
Text("no previous round") |
|
|
|
|
Text("seedInterval is missing (previous round)") |
|
|
|
|
} |
|
|
|
|
} else if let parentRound = loserRound.parentRound { |
|
|
|
|
if let seedInterval = parentRound.seedInterval(initialMode: isEditingTournamentSeed.wrappedValue == true) { |
|
|
|
|
Text(seedInterval.localizedLabel()) |
|
|
|
|
} else { |
|
|
|
|
Text("no parent round") |
|
|
|
|
Text("seedInterval is missing (parent round)") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -103,13 +103,7 @@ struct LoserRoundView: View { |
|
|
|
|
isEditingTournamentSeed.wrappedValue.toggle() |
|
|
|
|
|
|
|
|
|
if isEditingTournamentSeed.wrappedValue == false { |
|
|
|
|
let allRoundMatches = loserBracket.allMatches |
|
|
|
|
allRoundMatches.forEach({ $0.name = $0.roundTitle() }) |
|
|
|
|
do { |
|
|
|
|
try self.tournament.tournamentStore.matches.addOrUpdate(contentOfs: allRoundMatches) |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
_refreshNames() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -131,4 +125,17 @@ struct LoserRoundView: View { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func _refreshNames() { |
|
|
|
|
DispatchQueue.global(qos: .background).async { |
|
|
|
|
|
|
|
|
|
let allRoundMatches = loserBracket.allMatches |
|
|
|
|
allRoundMatches.forEach({ $0.name = $0.roundTitle() }) |
|
|
|
|
do { |
|
|
|
|
try self.tournament.tournamentStore.matches.addOrUpdate(contentOfs: allRoundMatches) |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|