mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 23:03:27 +01:00
Hides app updates that don’t support device’s OS version
This commit is contained in:
@@ -395,9 +395,9 @@ extension AppManager
|
||||
{
|
||||
completionHandler(.success((fetchedSources, managedObjectContext)))
|
||||
}
|
||||
|
||||
NotificationCenter.default.post(name: AppManager.didFetchSourceNotification, object: self)
|
||||
}
|
||||
|
||||
NotificationCenter.default.post(name: AppManager.didFetchSourceNotification, object: self)
|
||||
}
|
||||
|
||||
self.run(operations, context: nil)
|
||||
|
||||
@@ -185,7 +185,7 @@ private extension MyAppsViewController
|
||||
|
||||
func makeUpdatesDataSource() -> RSTFetchedResultsCollectionViewPrefetchingDataSource<InstalledApp, UIImage>
|
||||
{
|
||||
let fetchRequest = InstalledApp.updatesFetchRequest()
|
||||
let fetchRequest = InstalledApp.supportedUpdatesFetchRequest()
|
||||
fetchRequest.sortDescriptors = [NSSortDescriptor(keyPath: \InstalledApp.storeApp?.latestSupportedVersion?.date, ascending: false),
|
||||
NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true)]
|
||||
fetchRequest.returnsObjectsAsFaults = false
|
||||
@@ -479,6 +479,15 @@ private extension MyAppsViewController
|
||||
{
|
||||
func update()
|
||||
{
|
||||
do
|
||||
{
|
||||
try self.updatesDataSource.fetchedResultsController.performFetch()
|
||||
}
|
||||
catch
|
||||
{
|
||||
print("[ALTLog] Failed to fetch updates:", error)
|
||||
}
|
||||
|
||||
if self.updatesDataSource.itemCount > 0
|
||||
{
|
||||
self.navigationController?.tabBarItem.badgeValue = String(describing: self.updatesDataSource.itemCount)
|
||||
@@ -489,13 +498,6 @@ private extension MyAppsViewController
|
||||
self.navigationController?.tabBarItem.badgeValue = nil
|
||||
UIApplication.shared.applicationIconBadgeNumber = 0
|
||||
}
|
||||
|
||||
if self.isViewLoaded
|
||||
{
|
||||
UIView.performWithoutAnimation {
|
||||
self.collectionView.reloadSections(IndexSet(integer: Section.updates.rawValue))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func fetchAppIDs()
|
||||
|
||||
Reference in New Issue
Block a user