removes payment for summons

newoffer2025
Laurent 2 months ago
parent f6076a4230
commit c191288eb7
  1. 20
      PadelClub/Views/Calling/CallView.swift
  2. 2
      PadelClub/Views/Calling/Components/MenuWarningView.swift
  3. 19
      PadelClub/Views/Calling/SendToAllView.swift
  4. 10
      PadelClub/Views/GroupStage/Components/GroupStageTeamView.swift
  5. 10
      PadelClub/Views/Team/EditingTeamView.swift

@ -262,12 +262,10 @@ struct CallView: View {
NavigationStack {
LoginView(reason: LoginReason.loginRequiredForFeature) { _ in
self.showUserCreationView = false
self._payTournamentAndExecute {
self._summon(byMessage: self.summonParamByMessage,
reSummon: self.summonParamByMessage)
}
}
}
})
}
@ -353,7 +351,6 @@ struct CallView: View {
self.summonParamByMessage = byMessage
self.summonParamReSummon = reSummon
self._verifyUser {
self._payTournamentAndExecute {
if byMessage {
self._contactByMessage(reSummon: reSummon, forcedEmptyMessage: forcedEmptyMessage)
} else {
@ -361,7 +358,6 @@ struct CallView: View {
}
}
}
}
fileprivate func _verifyUser(_ handler: () -> ()) {
if StoreCenter.main.userId != nil {
@ -371,14 +367,14 @@ struct CallView: View {
}
}
fileprivate func _payTournamentAndExecute(_ handler: () -> ()) {
do {
try self.tournament.payIfNecessary()
handler()
} catch {
self.showSubscriptionView = true
}
}
// fileprivate func _payTournamentAndExecute(_ handler: () -> ()) {
// do {
// try self.tournament.payIfNecessary()
// handler()
// } catch {
// self.showSubscriptionView = true
// }
// }
fileprivate func _contactByMessage(reSummon: Bool, forcedEmptyMessage: Bool) {
self.contactType = .message(date: callDate,

@ -147,11 +147,9 @@ struct MenuWarningView: View {
fileprivate func _tryToContact() {
self._verifyUser {
self._payTournamentAndExecute {
self.contactType = self.savedContactType
}
}
}
fileprivate func _verifyUser(_ handler: () -> ()) {
if StoreCenter.main.userId != nil {

@ -272,15 +272,12 @@ struct SendToAllView: View {
fileprivate func _contact() {
self._verifyUser {
self._payTournamentAndExecute {
if contactMethod == 0 {
contactType = .message(date: nil, recipients: _teams().flatMap { $0.unsortedPlayers() }.compactMap { $0.phoneNumber }, body: finalMessage(), tournamentBuild: nil)
} else {
contactType = .mail(date: nil, recipients: tournament.umpireMail(), bccRecipients: _teams().flatMap { $0.unsortedPlayers() }.compactMap { $0.email }, body: finalMessage(), subject: tournament.mailSubject(), tournamentBuild: nil)
}
}
}
}
@ -292,14 +289,14 @@ struct SendToAllView: View {
}
}
fileprivate func _payTournamentAndExecute(_ handler: () -> ()) {
do {
try tournament.payIfNecessary()
handler()
} catch {
self.showSubscriptionView = true
}
}
// fileprivate func _payTournamentAndExecute(_ handler: () -> ()) {
// do {
// try tournament.payIfNecessary()
// handler()
// } catch {
// self.showSubscriptionView = true
// }
// }
private var _networkErrorMessage: String {
ContactManagerError.getNetworkErrorMessage(sentError: sentError, networkMonitorConnected: networkMonitor.connected)

@ -147,7 +147,6 @@ struct GroupStageTeamView: View {
Group {
switch contactType {
case .message(_, let recipients, let body, _):
if Guard.main.paymentForNewTournament() != nil {
MessageComposeView(recipients: recipients, body: body) { result in
switch result {
case .cancelled:
@ -167,12 +166,7 @@ struct GroupStageTeamView: View {
break
}
}
} else {
SubscriptionView(isPresented: self.$showSubscriptionView, showLackOfPlanMessage: true)
.environment(\.colorScheme, .light)
}
case .mail(_, let recipients, let bccRecipients, let body, let subject, _):
if Guard.main.paymentForNewTournament() != nil {
MailComposeView(recipients: recipients, bccRecipients: bccRecipients, body: body, subject: subject) { result in
switch result {
case .cancelled, .saved:
@ -193,10 +187,6 @@ struct GroupStageTeamView: View {
break
}
}
} else {
SubscriptionView(isPresented: self.$showSubscriptionView, showLackOfPlanMessage: true)
.environment(\.colorScheme, .light)
}
}
}
.tint(.master)

@ -354,7 +354,6 @@ struct EditingTeamView: View {
Group {
switch contactType {
case .message(_, let recipients, let body, _):
if Guard.main.paymentForNewTournament() != nil {
MessageComposeView(recipients: recipients, body: body) { result in
switch result {
case .cancelled:
@ -374,12 +373,7 @@ struct EditingTeamView: View {
break
}
}
} else {
SubscriptionView(isPresented: self.$showSubscriptionView, showLackOfPlanMessage: true)
.environment(\.colorScheme, .light)
}
case .mail(_, let recipients, let bccRecipients, let body, let subject, _):
if Guard.main.paymentForNewTournament() != nil {
MailComposeView(recipients: recipients, bccRecipients: bccRecipients, body: body, subject: subject) { result in
switch result {
case .cancelled, .saved:
@ -400,10 +394,6 @@ struct EditingTeamView: View {
break
}
}
} else {
SubscriptionView(isPresented: self.$showSubscriptionView, showLackOfPlanMessage: true)
.environment(\.colorScheme, .light)
}
}
}
.tint(.master)

Loading…
Cancel
Save