Regression in purchase elegibility predicate (#460)

The cancellation predicate does not include the condition where
cancelled purchases is nil.
This commit is contained in:
Davide De Rosa 2024-01-09 18:17:05 +01:00 committed by GitHub
parent bf4dc6c920
commit 5794229f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Regression in purchase elegibility predicate. [#460](https://github.com/passepartoutvpn/passepartout-apple/pull/460)
## 2.3.1 (2024-01-06) ## 2.3.1 (2024-01-06)
### Fixed ### Fixed

View File

@ -219,11 +219,11 @@ extension ProductManager {
extension ProductManager { extension ProductManager {
func isActivePurchase(_ feature: LocalProduct) -> Bool { func isActivePurchase(_ feature: LocalProduct) -> Bool {
purchasedFeatures.contains(feature) && cancelledPurchases?.contains(feature) == false purchasedFeatures.contains(feature) && cancelledPurchases?.contains(feature) != true
} }
func isActivePurchase(where predicate: (LocalProduct) -> Bool) -> Bool { func isActivePurchase(where predicate: (LocalProduct) -> Bool) -> Bool {
purchasedFeatures.contains(where: predicate) && cancelledPurchases?.contains(where: predicate) == false purchasedFeatures.contains(where: predicate) && cancelledPurchases?.contains(where: predicate) != true
} }
func isCurrentPlatformVersion() -> Bool { func isCurrentPlatformVersion() -> Bool {