diff --git a/Passepartout-iOS/Global/ProductManager.swift b/Passepartout-iOS/Global/ProductManager.swift index 143360fa..623c8e98 100644 --- a/Passepartout-iOS/Global/ProductManager.swift +++ b/Passepartout-iOS/Global/ProductManager.swift @@ -41,7 +41,7 @@ class ProductManager: NSObject { private var purchasedAppBuild: Int? - private(set) var purchasedFeatures: Set + private var purchasedFeatures: Set private var refreshRequest: SKReceiptRefreshRequest? @@ -157,6 +157,10 @@ class ProductManager: NSObject { return $0.rawValue.hasSuffix("providers.\(name.rawValue)") } } + + func isEligibleForFeedback() -> Bool { + return AppConstants.Flags.isBeta || !purchasedFeatures.isEmpty + } } extension ConnectionService { diff --git a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift index 6e07f843..8f841e7e 100644 --- a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift @@ -44,8 +44,10 @@ class OrganizerViewController: UITableViewController, StrongTableHost { // MARK: StrongTableHost - let model: StrongTableModel = { - let model: StrongTableModel = StrongTableModel() + let model: StrongTableModel = StrongTableModel() + + func reloadModel() { + model.clear() model.add(.vpn) model.add(.providers) model.add(.hosts) @@ -53,7 +55,9 @@ class OrganizerViewController: UITableViewController, StrongTableHost { model.add(.siri) } model.add(.support) - model.add(.feedback) + if ProductManager.shared.isEligibleForFeedback() { + model.add(.feedback) + } model.add(.about) model.add(.destruction) model.setHeader(L10n.App.Service.Sections.Vpn.header, forSection: .vpn) @@ -78,10 +82,9 @@ class OrganizerViewController: UITableViewController, StrongTableHost { model.setHeader("Beta", forSection: .test) model.set([.testDisplayLog, .testTermination], forSection: .test) } - return model - }() - - func reloadModel() { + + // + providers = service.ids(forContext: .provider).sorted() hosts = service.ids(forContext: .host).sortedCaseInsensitive() diff --git a/Passepartout-iOS/Scenes/ServiceViewController.swift b/Passepartout-iOS/Scenes/ServiceViewController.swift index 8d206faf..0a5b67ba 100644 --- a/Passepartout-iOS/Scenes/ServiceViewController.swift +++ b/Passepartout-iOS/Scenes/ServiceViewController.swift @@ -1158,7 +1158,9 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog model.add(.trusted) model.add(.trustedPolicy) model.add(.diagnostics) - model.add(.feedback) + if ProductManager.shared.isEligibleForFeedback() { + model.add(.feedback) + } } // headers