Fixes not showing “more updates” button when there are more than 2 updates

This commit is contained in:
Riley Testut
2024-02-15 16:06:09 -06:00
committed by Magesh K
parent 2899e3ea5f
commit aa1ed04bce

View File

@@ -1662,7 +1662,7 @@ extension MyAppsViewController
headerView.button.titleLabel?.transform = CGAffineTransform.identity.rotated(by: .pi) headerView.button.titleLabel?.transform = CGAffineTransform.identity.rotated(by: .pi)
} }
headerView.isHidden = (self.updatesDataSource.itemCount <= 2) headerView.isHidden = (self.updatesDataSource.fetchedResultsController.fetchedObjects?.count ?? 0 <= maximumCollapsedUpdatesCount)
headerView.button.layoutIfNeeded() headerView.button.layoutIfNeeded()
} }
@@ -2041,7 +2041,7 @@ extension MyAppsViewController: UICollectionViewDelegateFlowLayout
{ {
case .noUpdates: return .zero case .noUpdates: return .zero
case .updates: case .updates:
let height: CGFloat = self.updatesDataSource.itemCount > maximumCollapsedUpdatesCount ? 26 : 0 let height: CGFloat = (self.updatesDataSource.fetchedResultsController.fetchedObjects?.count ?? 0 > maximumCollapsedUpdatesCount) ? 26 : 0
return CGSize(width: collectionView.bounds.width, height: height) return CGSize(width: collectionView.bounds.width, height: height)
case .activeApps: return CGSize(width: collectionView.bounds.width, height: 29) case .activeApps: return CGSize(width: collectionView.bounds.width, height: 29)