fix no contact data

sync2
Raz 1 year ago
parent 42e1598fb4
commit fe737d2493
  1. 4
      PadelClub/Utils/ContactManager.swift
  2. 4
      PadelClub/Views/Calling/Components/PlayersWithoutContactView.swift

@ -31,7 +31,7 @@ enum ContactManagerError: LocalizedError {
case .messageNotSent: case .messageNotSent:
return "Le SMS n'a pas été envoyé" return "Le SMS n'a pas été envoyé"
case .uncalledTeams(let array): 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" return "Attention, \(array.count) équipe\(array.count.pluralSuffix) ne \(verb) pas être contacté par la méthode choisie"
case .calendarAccessDenied: case .calendarAccessDenied:
return "Padel Club n'a pas accès à votre calendrier" 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" return "Padel Club n'a pas réussi à sauver ce tournoi dans votre calendrier"
case .noCalendarAvailable: case .noCalendarAvailable:
return "Padel Club n'a pas réussi à trouver un calendrier pour y inscrire ce tournoi" return "Padel Club n'a pas réussi à trouver un calendrier pour y inscrire ce tournoi"
default:
break
} }
} }

@ -13,7 +13,7 @@ struct PlayersWithoutContactView: View {
var body: some View { var body: some View {
Section { Section {
let withoutEmails = players.filter({ $0.email?.isEmpty == true }) let withoutEmails = players.filter({ $0.email?.isEmpty == true || $0.email == nil })
DisclosureGroup { DisclosureGroup {
ForEach(withoutEmails) { player in ForEach(withoutEmails) { player in
NavigationLink { 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 { DisclosureGroup {
ForEach(withoutPhones) { player in ForEach(withoutPhones) { player in
NavigationLink { NavigationLink {

Loading…
Cancel
Save