fix round pas trouvé

club_update
Razmig Sarkissian 1 year ago
parent 72d143759d
commit 785cf4ba63
  1. 16
      PadelClub/Data/Round.swift

@ -498,7 +498,7 @@ defer {
return seedInterval.localizedLabel(displayStyle) return seedInterval.localizedLabel(displayStyle)
} }
print("Round pas trouvé", id, parent, index) print("Round pas trouvé", id, parent, index)
return "Round pas trouvé" return "--"
} }
return RoundRule.roundName(fromRoundIndex: index, displayStyle: displayStyle) return RoundRule.roundName(fromRoundIndex: index, displayStyle: displayStyle)
} }
@ -574,7 +574,19 @@ defer {
let matches = (0..<matchCount).map { //0 is final match let matches = (0..<matchCount).map { //0 is final match
let roundIndex = RoundRule.roundIndex(fromMatchIndex: $0) let roundIndex = RoundRule.roundIndex(fromMatchIndex: $0)
let round = rounds[roundIndex] let round = rounds[roundIndex]
return Match(round: round.id, index: $0, matchFormat: loserBracketMatchFormat, name: round.roundTitle()) return Match(round: round.id, index: $0, matchFormat: loserBracketMatchFormat)
}
do {
try self.tournamentStore.matches.addOrUpdate(contentOfs: matches)
} catch {
Logger.error(error)
}
matches.forEach { //0 is final match
let roundIndex = RoundRule.roundIndex(fromMatchIndex: $0.index)
let round = rounds[roundIndex]
$0.name = round.roundTitle()
} }
do { do {

Loading…
Cancel
Save