diff --git a/Sources/SKHelper/Core/SKHelper.swift b/Sources/SKHelper/Core/SKHelper.swift index fdf0b0350..ea2905366 100644 --- a/Sources/SKHelper/Core/SKHelper.swift +++ b/Sources/SKHelper/Core/SKHelper.swift @@ -741,7 +741,7 @@ public class SKHelper: Observable { /// Clears all in-memory and persisted cached entitlements. /// public func clearCachedEntitlements() { - products.map { $0.hasEntitlement = false } + products.forEach { $0.hasEntitlement = false } UserDefaults.standard.set([ProductId](), forKey: SKHelperConstants.PurchasedProductsKey) } diff --git a/Sources/SKHelper/Styles/SKHelperProductViewStyle.swift b/Sources/SKHelper/Styles/SKHelperProductViewStyle.swift index 66900b692..40ed516b2 100644 --- a/Sources/SKHelper/Styles/SKHelperProductViewStyle.swift +++ b/Sources/SKHelper/Styles/SKHelperProductViewStyle.swift @@ -95,8 +95,8 @@ public struct SKHelperProductViewStyle: ProductViewStyle { if let latestTransaction { switch latestTransaction { - case .unverified(let _, let _): value = false - case .verified(let _): value = true + case .unverified(_, _): value = false + case .verified(_): value = true } } diff --git a/Sources/SKHelper/Views/SKHelperPurchaseInfoMain.swift b/Sources/SKHelper/Views/SKHelperPurchaseInfoMain.swift index cff44f9ca..fe87b8f0c 100644 --- a/Sources/SKHelper/Views/SKHelperPurchaseInfoMain.swift +++ b/Sources/SKHelper/Views/SKHelperPurchaseInfoMain.swift @@ -44,7 +44,7 @@ internal struct SKHelperPurchaseInfoMain: View { private func purchaseType(info: SKHelperPurchaseInfo) -> String { if let ownershipType = info.ownershipType { - var value = ownershipType == .purchased ? "Personal purchase" : "Family sharing" + let value = ownershipType == .purchased ? "Personal purchase" : "Family sharing" return "\(value) (\(productType.localizedDescription))" } @@ -52,7 +52,7 @@ internal struct SKHelperPurchaseInfoMain: View { } private func notes(info: SKHelperPurchaseInfo) -> String { - if let revocationDate = info.revocationDate { + if info.revocationDate != nil { return "Purchased revoked \(info.revocationDateFormatted ?? "") \(info.revocationReason == .developerIssue ? "(developer issue)" : "(other)")" } diff --git a/Sources/SKHelper/Views/SKHelperSubscriptionInfoMain.swift b/Sources/SKHelper/Views/SKHelperSubscriptionInfoMain.swift index 4238b1424..13a72c854 100644 --- a/Sources/SKHelper/Views/SKHelperSubscriptionInfoMain.swift +++ b/Sources/SKHelper/Views/SKHelperSubscriptionInfoMain.swift @@ -70,7 +70,7 @@ internal struct SKHelperSubscriptionInfoMain: View { private func purchaseType(info: SKHelperSubscriptionInfo) -> String { if let ownershipType = info.ownershipType { - var value = ownershipType == .purchased ? "Personal purchase" : "Family sharing" + let value = ownershipType == .purchased ? "Personal purchase" : "Family sharing" return "\(value) (subscription)" } @@ -78,7 +78,7 @@ internal struct SKHelperSubscriptionInfoMain: View { } private func notes(info: SKHelperSubscriptionInfo) -> String { - if let revocationDate = info.revocationDate { + if info.revocationDate != nil { return "Purchased revoked \(info.revocationDateFormatted ?? "") \(info.revocationReason == .developerIssue ? "(developer issue)" : "(other)")" }