Adds purchase debugging info

sync3
Laurent 6 months ago
parent 450966eaf5
commit 4131c4bc1a
  1. 25
      PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift

@ -26,6 +26,18 @@ struct DebugSettingsView: View {
LabeledContent("Token", value: self._token)
LabeledContent("Server", value: self._apiURL)
LabeledContent("Synchronized", value: self._synchronized)
LabeledContent("Plan", value: Guard.main.currentPlan?.id ?? "None")
NavigationLink {
List {
ForEach(DataStore.shared.purchases) { purchase in
DebugPurchaseView(purchase: purchase)
}
}
} label: {
LabeledContent("Purchases", value: DataStore.shared.purchases.count.formatted())
}
}
}
}
@ -69,6 +81,19 @@ struct DebugSettingsView: View {
}
}
struct DebugPurchaseView: View {
var purchase: Purchase
var body: some View {
VStack {
Text(purchase.productId)
LabeledContent(purchase.purchaseDate.formatted(), value: purchase.expirationDate?.formatted() ?? "")
}
}
}
//#Preview {
// DebugSettingsView()
//}

Loading…
Cancel
Save