paca_championship
Raz 10 months ago
parent 354ae4c527
commit bd2ba72560
  1. 32
      PadelClub/Views/Tournament/Screen/InscriptionManagerView.swift

@ -481,12 +481,10 @@ struct InscriptionManagerView: View {
// Text("En csv") // Text("En csv")
// } // }
// } // }
// if let teamPaste = teamPaste(.championship) { ShareLink(item: teamPaste(.championship), preview: .init("championship")) {
ShareLink(item: teamPaste(.championship)) { Text("championship")
Text("En csv pour la ligue") }
}
// }
} label: { } label: {
Label("Exporter les paires", systemImage: "square.and.arrow.up") Label("Exporter les paires", systemImage: "square.and.arrow.up")
} }
@ -877,13 +875,19 @@ struct InscriptionManagerView: View {
Button { Button {
Task { Task {
gatheringInProgress = true DispatchQueue.main.async {
gathered = 0 gatheringInProgress = true
gatheringDone = false gathered = 0
gatheringDone = false
}
let unrankedUnsourced = tournament.players().filter { $0.isUnranked() && $0.source == nil } let unrankedUnsourced = tournament.players().filter { $0.isUnranked() && $0.source == nil }
totalUnrankedUnsourced = Double(unrankedUnsourced.count)
print("total", unrankedUnsourced.count)
DispatchQueue.main.async {
totalUnrankedUnsourced = Double(unrankedUnsourced.count)
print("total", unrankedUnsourced.count)
}
await withTaskGroup(of: Void.self) { group in await withTaskGroup(of: Void.self) { group in
var playersToSave = [PlayerRegistration]() var playersToSave = [PlayerRegistration]()
for player in unrankedUnsourced { for player in unrankedUnsourced {
@ -896,7 +900,7 @@ struct InscriptionManagerView: View {
player.source = .frenchFederation player.source = .frenchFederation
playersToSave.append(player) playersToSave.append(player)
} }
await MainActor.run { DispatchQueue.main.async {
gathered += 1 gathered += 1
print("gathered", gathered) print("gathered", gathered)
} }
@ -1220,10 +1224,6 @@ struct TournamentShareFile: Transferable {
} }
static var transferRepresentation: some TransferRepresentation { static var transferRepresentation: some TransferRepresentation {
FileRepresentation(exportedContentType: .utf8PlainText) { transferable in
return SentTransferredFile(transferable.shareFile())
}
ProxyRepresentation { transferable in ProxyRepresentation { transferable in
return transferable.shareFile() return transferable.shareFile()
} }

Loading…
Cancel
Save