forked from shadowfacts/Tusker
Fix Trending Posts reloading on every appearance
This commit is contained in:
parent
b90262bfd0
commit
77ab2c3753
|
@ -18,6 +18,8 @@ class TrendingStatusesViewController: UIViewController {
|
||||||
}
|
}
|
||||||
private var dataSource: UICollectionViewDiffableDataSource<Section, Item>!
|
private var dataSource: UICollectionViewDiffableDataSource<Section, Item>!
|
||||||
|
|
||||||
|
private var loaded = false
|
||||||
|
|
||||||
init(mastodonController: MastodonController) {
|
init(mastodonController: MastodonController) {
|
||||||
self.mastodonController = mastodonController
|
self.mastodonController = mastodonController
|
||||||
|
|
||||||
|
@ -89,7 +91,10 @@ class TrendingStatusesViewController: UIViewController {
|
||||||
dataSource.apply(snapshot, animatingDifferences: false)
|
dataSource.apply(snapshot, animatingDifferences: false)
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
await loadTrendingStatuses()
|
if !loaded {
|
||||||
|
loaded = true
|
||||||
|
await loadTrendingStatuses()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue