fix issue with groupstage start date

sync3
Razmig Sarkissian 5 months ago
parent e5f7cbfcd1
commit fae2e79207
  1. 4
      PadelClubData/Data/GroupStage.swift
  2. 3
      PadelClubData/Data/MatchScheduler.swift

@ -606,6 +606,10 @@ final public class GroupStage: BaseGroupStage, SideStorable {
guard hasEnded() else { return nil }
return teams(true).firstIndex(of: team)
}
public func computedStartDate() -> Date? {
return _matches().sorted(by: \.computedStartDateForSorting).first?.startDate
}
public override func deleteDependencies(store: Store, shouldBeSynchronized: Bool) {

@ -131,6 +131,9 @@ final public class MatchScheduler: BaseMatchScheduler, SideStorable {
} catch {
Logger.error(error)
}
groupStages.forEach({ $0.startDate = $0.computedStartDate() })
self.tournamentStore?.groupStages.addOrUpdate(contentOfs: groupStages)
return lastDate
}

Loading…
Cancel
Save