|
|
|
|
@ -259,6 +259,13 @@ struct EventListView: View { |
|
|
|
|
private func _tournamentView(_ tournament: Tournament) -> some View { |
|
|
|
|
NavigationLink(value: tournament) { |
|
|
|
|
TournamentCellView(tournament: tournament) |
|
|
|
|
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name.CollectionDidLoad), perform: { notification in |
|
|
|
|
|
|
|
|
|
if let store = notification.object as? StoredCollection<TeamRegistration>, store.id == tournament.id { |
|
|
|
|
tournament.lastTeamRefresh = Date() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
.id(tournament.lastTeamRefresh) |
|
|
|
|
.task(priority: .background) { |
|
|
|
|
await tournament.refreshTeamList() |
|
|
|
|
|