sync2
Laurent 8 months ago
parent 36504eec51
commit 3a17267c83
  1. 11
      PadelClub/Views/Navigation/Toolbox/APICallsListView.swift

@ -32,10 +32,10 @@ struct APICallsListView: View {
} }
func load() { func load() {
self.descriptors = Store.main.collectionNames().map { Task {
self.descriptors = await StoreCenter.main.apiCollectionDescriptors().map {
CollectionDescriptor(name: $0.0, type: $0.1) CollectionDescriptor(name: $0.0, type: $0.1)
}.sorted(by: \.name, order: .ascending) }.sorted(by: \.name, order: .ascending)
Task {
for descriptor in self.descriptors { for descriptor in self.descriptors {
if let type = descriptor.type as? any SyncedStorable.Type { if let type = descriptor.type as? any SyncedStorable.Type {
@ -85,6 +85,11 @@ struct APICallsView: View {
var body: some View { var body: some View {
List { List {
Section(header:
Text("\(apiCalls.count) API calls")
.font(.headline)
.foregroundColor(.primary)
) {
ForEach(self.apiCalls, id: \.id) { apiCall in ForEach(self.apiCalls, id: \.id) { apiCall in
NavigationLink { NavigationLink {
APICallView(apiCall: apiCall, type: self.type) APICallView(apiCall: apiCall, type: self.type)
@ -92,7 +97,7 @@ struct APICallsView: View {
LabeledContent(apiCall.method.rawValue, value: apiCall.attemptsCount.string) LabeledContent(apiCall.method.rawValue, value: apiCall.attemptsCount.string)
} }
} }
// Text(self.text).lineLimit(nil) }
}.navigationTitle(self.name) }.navigationTitle(self.name)
.onAppear { .onAppear {
self._load() self._load()

Loading…
Cancel
Save