Fix discover section sometimes appearing on non-Mastodon instances

This commit is contained in:
Shadowfacts 2023-02-05 14:36:09 -05:00
parent 429dcefa88
commit 3f34357692
1 changed files with 3 additions and 0 deletions

View File

@ -183,6 +183,9 @@ class ExploreViewController: UIViewController, UICollectionViewDelegate, Collect
if mastodonController.instanceFeatures.trends, if mastodonController.instanceFeatures.trends,
!snapshot.sectionIdentifiers.contains(.discover) { !snapshot.sectionIdentifiers.contains(.discover) {
addDiscoverSection(to: &snapshot) addDiscoverSection(to: &snapshot)
} else if !mastodonController.instanceFeatures.trends,
snapshot.sectionIdentifiers.contains(.discover) {
snapshot.deleteSections([.discover])
} }
self.dataSource.apply(snapshot) self.dataSource.apply(snapshot)
} }