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 loaded = false
|
||||
|
||||
init(mastodonController: MastodonController) {
|
||||
self.mastodonController = mastodonController
|
||||
|
||||
|
@ -89,9 +91,12 @@ class TrendingStatusesViewController: UIViewController {
|
|||
dataSource.apply(snapshot, animatingDifferences: false)
|
||||
|
||||
Task {
|
||||
if !loaded {
|
||||
loaded = true
|
||||
await loadTrendingStatuses()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func loadTrendingStatuses() async {
|
||||
let statuses: [Status]
|
||||
|
|
Loading…
Reference in New Issue