Fix constraint

This commit is contained in:
Niels Andriesse 2021-03-30 14:06:12 +11:00
parent cd9b48f9fe
commit 37ae8a3c0a
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ final class OpenGroupSuggestionGrid : UIView, UICollectionViewDataSource, UIColl
private func update() {
spinner.stopAnimating()
spinner.isHidden = true
let height = OpenGroupSuggestionGrid.cellHeight * ceil(CGFloat(rooms.count) / 2)
let roomCount = min(rooms.count, 8) // Cap to a maximum of 8 (4 rows of 2)
let height = OpenGroupSuggestionGrid.cellHeight * ceil(CGFloat(roomCount) / 2)
heightConstraint.constant = height
collectionView.reloadData()
}