Fix add saved hashtag search results selection not being cleared
This commit is contained in:
parent
522e7830e5
commit
93e72e1cb6
|
@ -9,14 +9,14 @@
|
|||
import UIKit
|
||||
import Pachyderm
|
||||
|
||||
class AddSavedHashtagViewController: UIViewController {
|
||||
class AddSavedHashtagViewController: UIViewController, CollectionViewController {
|
||||
|
||||
weak var mastodonController: MastodonController!
|
||||
|
||||
var resultsController: SearchResultsViewController!
|
||||
var searchController: UISearchController!
|
||||
|
||||
private var collectionView: UICollectionView!
|
||||
private(set) var collectionView: UICollectionView!
|
||||
private var dataSource: UICollectionViewDiffableDataSource<Section, Item>!
|
||||
|
||||
init(mastodonController: MastodonController) {
|
||||
|
@ -91,6 +91,12 @@ class AddSavedHashtagViewController: UIViewController {
|
|||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
if searchController.isActive {
|
||||
resultsController.clearSelectionOnAppear(animated: animated)
|
||||
}
|
||||
|
||||
clearSelectionOnAppear(animated: animated)
|
||||
|
||||
let request = Client.getTrendingHashtags(limit: 10)
|
||||
mastodonController.run(request) { (response) in
|
||||
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
|
||||
|
|
|
@ -96,7 +96,7 @@ class ExploreViewController: UIViewController, UICollectionViewDelegate, Collect
|
|||
// so we manually propagate this down to the results controller
|
||||
// so that it can deselect on appear
|
||||
if searchController.isActive {
|
||||
resultsController.viewWillAppear(animated)
|
||||
resultsController.clearSelectionOnAppear(animated: animated)
|
||||
}
|
||||
|
||||
clearSelectionOnAppear(animated: animated)
|
||||
|
|
Loading…
Reference in New Issue