@@ -17,6 +17,7 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L
17
17
private let tableView : UITableView
18
18
private var dataSources : [ LocationDataSourceProtocol ] = [ ]
19
19
private var selectedItem : LocationCellViewModel ?
20
+ private var hasFilter = false
20
21
21
22
var didSelectRelayLocations : ( ( UserSelectedRelays ) -> Void ) ?
22
23
var didTapEditCustomLists : ( ( ) -> Void ) ?
@@ -47,6 +48,8 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L
47
48
}
48
49
49
50
func setRelays( _ response: REST . ServerRelaysResponse , selectedRelays: UserSelectedRelays ? , filter: RelayFilter ) {
51
+ hasFilter = filter. providers != . any || filter. ownership != . any
52
+
50
53
let allLocationsDataSource =
51
54
dataSources. first ( where: { $0 is AllLocationDataSource } ) as? AllLocationDataSource
52
55
@@ -58,7 +61,7 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L
58
61
}
59
62
60
63
allLocationsDataSource? . reload ( response, relays: relays)
61
- customListsDataSource? . reload ( allLocationNodes: allLocationsDataSource? . nodes ?? [ ] )
64
+ customListsDataSource? . reload ( allLocationNodes: allLocationsDataSource? . nodes ?? [ ] , isFiltered : hasFilter )
62
65
63
66
mapSelectedItem ( from: selectedRelays)
64
67
filterRelays ( by: currentSearchString)
@@ -101,7 +104,7 @@ final class LocationDataSource: UITableViewDiffableDataSource<LocationSection, L
101
104
let customListsDataSource =
102
105
dataSources. first ( where: { $0 is CustomListsDataSource } ) as? CustomListsDataSource
103
106
104
- customListsDataSource? . reload ( allLocationNodes: allLocationsDataSource? . nodes ?? [ ] )
107
+ customListsDataSource? . reload ( allLocationNodes: allLocationsDataSource? . nodes ?? [ ] , isFiltered : hasFilter )
105
108
106
109
mapSelectedItem ( from: selectedRelays)
107
110
filterRelays ( by: currentSearchString, scrollToSelected: false )
0 commit comments