Compare commits

..

2 Commits

2 changed files with 17 additions and 9 deletions

View File

@ -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])
Task { dataSource.apply(snapshot, animatingDifferences: false)
if !loaded {
loaded = true Task {
await loadTrendingStatuses() await loadTrendingStatuses()
} }
} }

View File

@ -35,7 +35,15 @@ extension ToastableViewController {
} }
var toastParentView: UIView { view } var toastParentView: UIView { view }
var toastScrollView: UIScrollView? { view as? UIScrollView } var toastScrollView: UIScrollView? {
if let scrollView = view as? UIScrollView {
return scrollView
} else if let collectionVC = self as? CollectionViewController {
return collectionVC.collectionView
} else {
return nil
}
}
func showToast(configuration config: ToastConfiguration, animated: Bool) { func showToast(configuration config: ToastConfiguration, animated: Bool) {
currentToast?.dismissToast(animated: false) currentToast?.dismissToast(animated: false)