From fe737d24935d3aa81234de016fb38577d9d65fca Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 20 Sep 2024 17:03:17 +0200 Subject: [PATCH] fix no contact data --- PadelClub/Utils/ContactManager.swift | 4 +--- .../Views/Calling/Components/PlayersWithoutContactView.swift | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PadelClub/Utils/ContactManager.swift b/PadelClub/Utils/ContactManager.swift index 3c6b01b..5c9d793 100644 --- a/PadelClub/Utils/ContactManager.swift +++ b/PadelClub/Utils/ContactManager.swift @@ -31,7 +31,7 @@ enum ContactManagerError: LocalizedError { case .messageNotSent: return "Le SMS n'a pas été envoyé" case .uncalledTeams(let array): - let verb = array.count > 1 ? "peut" : "peuvent" + let verb = array.count > 1 ? "peuvent" : "peut" return "Attention, \(array.count) équipe\(array.count.pluralSuffix) ne \(verb) pas être contacté par la méthode choisie" case .calendarAccessDenied: return "Padel Club n'a pas accès à votre calendrier" @@ -39,8 +39,6 @@ enum ContactManagerError: LocalizedError { return "Padel Club n'a pas réussi à sauver ce tournoi dans votre calendrier" case .noCalendarAvailable: return "Padel Club n'a pas réussi à trouver un calendrier pour y inscrire ce tournoi" - default: - break } } diff --git a/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift b/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift index 6b75e8c..4e8d78e 100644 --- a/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift +++ b/PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift @@ -13,7 +13,7 @@ struct PlayersWithoutContactView: View { var body: some View { Section { - let withoutEmails = players.filter({ $0.email?.isEmpty == true }) + let withoutEmails = players.filter({ $0.email?.isEmpty == true || $0.email == nil }) DisclosureGroup { ForEach(withoutEmails) { player in NavigationLink { @@ -31,7 +31,7 @@ struct PlayersWithoutContactView: View { } } - let withoutPhones = players.filter({ $0.phoneNumber?.isEmpty == true }) + let withoutPhones = players.filter({ $0.phoneNumber?.isEmpty == true || $0.phoneNumber == nil }) DisclosureGroup { ForEach(withoutPhones) { player in NavigationLink {