From fceb61c08e8214a3586d6e11e788ac966c81877c Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Wed, 15 May 2024 23:15:13 +0200 Subject: [PATCH] fixes --- PadelClub/Data/Tournament.swift | 5 ++++- PadelClub/Views/Tournament/Screen/BroadcastView.swift | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PadelClub/Data/Tournament.swift b/PadelClub/Data/Tournament.swift index a7cbc57..dae330b 100644 --- a/PadelClub/Data/Tournament.swift +++ b/PadelClub/Data/Tournament.swift @@ -234,7 +234,10 @@ class Tournament : ModelObject, Storable { try container.encode(additionalEstimationDuration, forKey: ._additionalEstimationDuration) try container.encode(isDeleted, forKey: ._isDeleted) 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) throws { diff --git a/PadelClub/Views/Tournament/Screen/BroadcastView.swift b/PadelClub/Views/Tournament/Screen/BroadcastView.swift index 74f33b2..0e9e3f5 100644 --- a/PadelClub/Views/Tournament/Screen/BroadcastView.swift +++ b/PadelClub/Views/Tournament/Screen/BroadcastView.swift @@ -57,7 +57,7 @@ struct BroadcastView: View { } header: { Text("Liste des équipes") } footer: { - if tournament.publishedTeamsDate() < Date() { + if Date() < tournament.publishedTeamsDate() { FooterButtonView(tournament.publishTeams ? "masquer sur le site" : "publier maintenant") { tournament.publishTeams.toggle() } @@ -81,7 +81,7 @@ struct BroadcastView: View { } header: { Text("Convocations") } footer: { - if tournament.publishedTeamsDate() < Date() { + if Date() < tournament.publishedTeamsDate() { FooterButtonView(tournament.publishSummons ? "masquer sur le site" : "publier maintenant") { tournament.publishSummons.toggle() } @@ -107,7 +107,7 @@ struct BroadcastView: View { } header: { Text("Poules") } footer: { - if publishedGroupStagesDate < Date() { + if Date() < publishedGroupStagesDate { FooterButtonView(tournament.publishGroupStages ? "masquer sur le site" : "publier maintenant") { tournament.publishGroupStages.toggle() } @@ -134,7 +134,7 @@ struct BroadcastView: View { } header: { Text("Tableau") } footer: { - if publishedBracketsDate < Date() { + if Date() < publishedBracketsDate{ FooterButtonView(tournament.publishBrackets ? "masquer sur le site" : "publier maintenant") { tournament.publishBrackets.toggle() }