Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
russell-archer committed Sep 27, 2024
1 parent 5d02f68 commit f2b2cd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Sources/SKHelper/Core/SKHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/SKHelper/Styles/SKHelperProductViewStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/SKHelper/Views/SKHelperPurchaseInfoMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ 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))"
}

return "Unknown (\(productType.localizedDescription))"
}

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)")"
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/SKHelper/Views/SKHelperSubscriptionInfoMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ 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)"
}

return "Unknown (subscription)"
}

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)")"
}

Expand Down

0 comments on commit f2b2cd6

Please sign in to comment.