Fix bug with purchases retrieved from the server

sync3
Laurent 6 months ago
parent 6c5aa3fc34
commit 435fa59d58
  1. 7
      PadelClubData/Subscriptions/Guard.swift

@ -48,7 +48,7 @@ import Combine
}
@objc func collectionDidLoad(notification: Notification) {
if let _ = notification.object as? StoredCollection<Purchase> {
if let _ = notification.object as? BaseCollection<Purchase> {
self._updateBestPlan()
}
}
@ -189,6 +189,11 @@ import Combine
}
public var currentPlan: StoreItem? {
if let currentBestPurchase = self.currentBestPurchase, let plan = StoreItem(rawValue: currentBestPurchase.productId) {
return plan
}
#if DEBUG
if let plan = PListReader.readString(plist: "local", key: "plan"), !plan.isEmpty {
return StoreItem(rawValue: plan)

Loading…
Cancel
Save