From 4131c4bc1a7c86893bc0e9e1896fc16cd0d6e575 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 5 May 2025 16:35:49 +0200 Subject: [PATCH] Adds purchase debugging info --- .../Toolbox/DebugSettingsView.swift | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift b/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift index 8e40f3d..95ec2a3 100644 --- a/PadelClub/Views/Navigation/Toolbox/DebugSettingsView.swift +++ b/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() //}