From 37ae8a3c0a2c39be10156e9599e3516dffaf69f0 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 30 Mar 2021 14:06:12 +1100 Subject: [PATCH] Fix constraint --- Session/Open Groups/OpenGroupSuggestionGrid.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Session/Open Groups/OpenGroupSuggestionGrid.swift b/Session/Open Groups/OpenGroupSuggestionGrid.swift index 99a2d7832..f79598b0f 100644 --- a/Session/Open Groups/OpenGroupSuggestionGrid.swift +++ b/Session/Open Groups/OpenGroupSuggestionGrid.swift @@ -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() }