forked from shadowfacts/Tusker
Fix Trending Posts appearing to reload forever
This commit is contained in:
parent
2891f47cb3
commit
382d8ef2c8
|
@ -85,14 +85,14 @@ class TrendingStatusesViewController: UIViewController {
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
|
|
||||||
|
if !loaded {
|
||||||
|
loaded = true
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
||||||
snapshot.appendSections([.statuses])
|
snapshot.appendSections([.statuses])
|
||||||
snapshot.appendItems([.loadingIndicator])
|
snapshot.appendItems([.loadingIndicator])
|
||||||
dataSource.apply(snapshot, animatingDifferences: false)
|
dataSource.apply(snapshot, animatingDifferences: false)
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
if !loaded {
|
|
||||||
loaded = true
|
|
||||||
await loadTrendingStatuses()
|
await loadTrendingStatuses()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue