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)
|
||||||
|
|
||||||
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
if !loaded {
|
||||||
snapshot.appendSections([.statuses])
|
loaded = true
|
||||||
snapshot.appendItems([.loadingIndicator])
|
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
||||||
dataSource.apply(snapshot, animatingDifferences: false)
|
snapshot.appendSections([.statuses])
|
||||||
|
snapshot.appendItems([.loadingIndicator])
|
||||||
|
dataSource.apply(snapshot, animatingDifferences: false)
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
if !loaded {
|
|
||||||
loaded = true
|
|
||||||
await loadTrendingStatuses()
|
await loadTrendingStatuses()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue