multistore
Razmig Sarkissian 2 years ago
parent 860eab9b76
commit fceb61c08e
  1. 5
      PadelClub/Data/Tournament.swift
  2. 8
      PadelClub/Views/Tournament/Screen/BroadcastView.swift

@ -234,7 +234,10 @@ class Tournament : ModelObject, Storable {
try container.encode(additionalEstimationDuration, forKey: ._additionalEstimationDuration) try container.encode(additionalEstimationDuration, forKey: ._additionalEstimationDuration)
try container.encode(isDeleted, forKey: ._isDeleted) try container.encode(isDeleted, forKey: ._isDeleted)
try self._encodeIsCanceled(container: &container) try self._encodeIsCanceled(container: &container)
try container.encode(publishTeams, forKey: ._publishTeams)
try container.encode(publishSummons, forKey: ._publishSummons)
try container.encode(publishBrackets, forKey: ._publishBrackets)
try container.encode(publishGroupStages, forKey: ._publishGroupStages)
} }
fileprivate func _encodePayment(container: inout KeyedEncodingContainer<CodingKeys>) throws { fileprivate func _encodePayment(container: inout KeyedEncodingContainer<CodingKeys>) throws {

@ -57,7 +57,7 @@ struct BroadcastView: View {
} header: { } header: {
Text("Liste des équipes") Text("Liste des équipes")
} footer: { } footer: {
if tournament.publishedTeamsDate() < Date() { if Date() < tournament.publishedTeamsDate() {
FooterButtonView(tournament.publishTeams ? "masquer sur le site" : "publier maintenant") { FooterButtonView(tournament.publishTeams ? "masquer sur le site" : "publier maintenant") {
tournament.publishTeams.toggle() tournament.publishTeams.toggle()
} }
@ -81,7 +81,7 @@ struct BroadcastView: View {
} header: { } header: {
Text("Convocations") Text("Convocations")
} footer: { } footer: {
if tournament.publishedTeamsDate() < Date() { if Date() < tournament.publishedTeamsDate() {
FooterButtonView(tournament.publishSummons ? "masquer sur le site" : "publier maintenant") { FooterButtonView(tournament.publishSummons ? "masquer sur le site" : "publier maintenant") {
tournament.publishSummons.toggle() tournament.publishSummons.toggle()
} }
@ -107,7 +107,7 @@ struct BroadcastView: View {
} header: { } header: {
Text("Poules") Text("Poules")
} footer: { } footer: {
if publishedGroupStagesDate < Date() { if Date() < publishedGroupStagesDate {
FooterButtonView(tournament.publishGroupStages ? "masquer sur le site" : "publier maintenant") { FooterButtonView(tournament.publishGroupStages ? "masquer sur le site" : "publier maintenant") {
tournament.publishGroupStages.toggle() tournament.publishGroupStages.toggle()
} }
@ -134,7 +134,7 @@ struct BroadcastView: View {
} header: { } header: {
Text("Tableau") Text("Tableau")
} footer: { } footer: {
if publishedBracketsDate < Date() { if Date() < publishedBracketsDate{
FooterButtonView(tournament.publishBrackets ? "masquer sur le site" : "publier maintenant") { FooterButtonView(tournament.publishBrackets ? "masquer sur le site" : "publier maintenant") {
tournament.publishBrackets.toggle() tournament.publishBrackets.toggle()
} }

Loading…
Cancel
Save