mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-18 14:39:09 +00:00
Restrict "Feedback" sections to beta/paying users
Act as a rudimental spam filter.
This commit is contained in:
parent
14edeab889
commit
ebbcaa674b
@ -41,7 +41,7 @@ class ProductManager: NSObject {
|
||||
|
||||
private var purchasedAppBuild: Int?
|
||||
|
||||
private(set) var purchasedFeatures: Set<Product>
|
||||
private var purchasedFeatures: Set<Product>
|
||||
|
||||
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 {
|
||||
|
@ -44,8 +44,10 @@ class OrganizerViewController: UITableViewController, StrongTableHost {
|
||||
|
||||
// MARK: StrongTableHost
|
||||
|
||||
let model: StrongTableModel<SectionType, RowType> = {
|
||||
let model: StrongTableModel<SectionType, RowType> = StrongTableModel()
|
||||
let model: StrongTableModel<SectionType, RowType> = 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()
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user