Switches from StoreApp.isBeta to isPledged to determine whether app is visible

If StoreApp.isHiddenWithoutPledge == false (default), we’ll still show the app.
This commit is contained in:
Riley Testut
2023-11-29 18:08:42 -06:00
committed by Magesh K
parent aa9fda7a97
commit 389af4d5e6
6 changed files with 25 additions and 16 deletions

View File

@@ -93,7 +93,6 @@ class BrowseViewController: UICollectionViewController, PeekPopPreviewing
super.viewWillAppear(animated)
self.fetchSource()
self.updateDataSource()
self.update()
}
@@ -110,7 +109,8 @@ private extension BrowseViewController
NSSortDescriptor(keyPath: \StoreApp.bundleIdentifier, ascending: true)]
fetchRequest.returnsObjectsAsFaults = false
let predicate = NSPredicate(format: "%K != %@", #keyPath(StoreApp.bundleIdentifier), StoreApp.altstoreAppID)
let predicate = StoreApp.visibleAppsPredicate
if let source = self.source
{
let filterPredicate = NSPredicate(format: "%K == %@", #keyPath(StoreApp._source), source)

View File

@@ -113,11 +113,10 @@ class MyAppsViewController: UICollectionViewController, PeekPopPreviewing
(self as PeekPopPreviewing).registerForPreviewing(with: self, sourceView: self.collectionView)
}
override func viewWillAppear(_ animated: Bool)
override func viewIsAppearing(_ animated: Bool)
{
super.viewWillAppear(animated)
super.viewIsAppearing(animated)
self.updateDataSource()
self.update()
self.fetchAppIDs()

View File

@@ -215,7 +215,7 @@ private extension SourceDetailContentViewController
let dataSource = RSTArrayCollectionViewPrefetchingDataSource<StoreApp, UIImage>(items: limitedFeaturedApps)
dataSource.cellIdentifierHandler = { _ in "AppCell" }
dataSource.predicate = NSPredicate(format: "%K == NO", #keyPath(StoreApp.isBeta)) // Never show beta apps (at least until we support betas for other sources).
dataSource.predicate = StoreApp.visibleAppsPredicate
dataSource.cellConfigurationHandler = { [weak self] (cell, storeApp, indexPath) in
let cell = cell as! AppBannerCollectionViewCell
cell.tintColor = storeApp.tintColor

View File

@@ -231,15 +231,7 @@ private extension SourcesViewController
cell.bannerView.iconImageView.image = nil
cell.bannerView.iconImageView.isIndicatingActivity = true
let numberOfApps: Int
if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
{
numberOfApps = source.apps.count
}
else
{
numberOfApps = source.apps.filter { !$0.isBeta }.count
}
let numberOfApps = source.apps.filter { StoreApp.visibleAppsPredicate.evaluate(with: $0) }.count
if let error = source.error
{