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)
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()
} }
} }

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)