Fix Trending Posts appearing to reload forever

This commit is contained in:
Shadowfacts 2022-12-12 22:51:50 -05:00
parent 2891f47cb3
commit 382d8ef2c8
1 changed files with 8 additions and 8 deletions

View File

@ -85,14 +85,14 @@ class TrendingStatusesViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
snapshot.appendSections([.statuses])
snapshot.appendItems([.loadingIndicator])
dataSource.apply(snapshot, animatingDifferences: false)
Task {
if !loaded {
loaded = true
if !loaded {
loaded = true
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
snapshot.appendSections([.statuses])
snapshot.appendItems([.loadingIndicator])
dataSource.apply(snapshot, animatingDifferences: false)
Task {
await loadTrendingStatuses()
}
}