From ac641cfca04ce8510ce1113a9a734f0e27b67123 Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 6 Sep 2024 11:57:14 +0200 Subject: [PATCH] fix debug _disablePrivateToggle --- .../Views/Tournament/Screen/BroadcastView.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PadelClub/Views/Tournament/Screen/BroadcastView.swift b/PadelClub/Views/Tournament/Screen/BroadcastView.swift index 836197d..ba1d37b 100644 --- a/PadelClub/Views/Tournament/Screen/BroadcastView.swift +++ b/PadelClub/Views/Tournament/Screen/BroadcastView.swift @@ -113,10 +113,7 @@ struct BroadcastView: View { .foregroundStyle(.logoRed) } } - #if DEBUG - #else - .disabled((tournament.isPrivate && Guard.main.purchasedTransactions.isEmpty)) - #endif + .disabled(_disablePrivateToggle()) } footer: { let verb : String = tournament.isPrivate ? "est" : "sera" let footerString = " Le tournoi \(verb) masqué sur le site [Padel Club](\(URLs.main.rawValue))" @@ -326,6 +323,14 @@ struct BroadcastView: View { } } + private func _disablePrivateToggle() -> Bool { + #if DEBUG + return false + #else + return (tournament.isPrivate && Guard.main.purchasedTransactions.isEmpty) + #endif + } + private func _save() { do { if [tournament.publishTeams, tournament.publishSummons, tournament.publishBrackets, tournament.publishGroupStages].anySatisfy({ $0 == true }) {