From 5794229f94dc258d8886e0cf60cbb15ba6d58018 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 9 Jan 2024 18:17:05 +0100 Subject: [PATCH] Regression in purchase elegibility predicate (#460) The cancellation predicate does not include the condition where cancelled purchases is nil. --- CHANGELOG.md | 6 ++++++ .../PassepartoutFrontend/Managers/ProductManager.swift | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45cfdaf0..9f5866c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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) ### Fixed diff --git a/PassepartoutLibrary/Sources/PassepartoutFrontend/Managers/ProductManager.swift b/PassepartoutLibrary/Sources/PassepartoutFrontend/Managers/ProductManager.swift index 1460d382..71cf622a 100644 --- a/PassepartoutLibrary/Sources/PassepartoutFrontend/Managers/ProductManager.swift +++ b/PassepartoutLibrary/Sources/PassepartoutFrontend/Managers/ProductManager.swift @@ -219,11 +219,11 @@ extension ProductManager { extension ProductManager { 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 { - purchasedFeatures.contains(where: predicate) && cancelledPurchases?.contains(where: predicate) == false + purchasedFeatures.contains(where: predicate) && cancelledPurchases?.contains(where: predicate) != true } func isCurrentPlatformVersion() -> Bool {