File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Sources/InstantSearchCore Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,10 @@ extension GroupsStorage: FiltersWritable {
147
147
for groupID in groupIDs {
148
148
switch groupID {
149
149
case . hierarchical:
150
- filterGroups [ groupID] = filterGroups [ groupID] ? . withFilters ( [ ] )
150
+ if var cleanHierarchicalGroup = filterGroups [ groupID] ? . withFilters ( [ ] ) as? FilterGroup . Hierarchical {
151
+ cleanHierarchicalGroup. hierarchicalFilters. removeAll ( )
152
+ filterGroups [ groupID] = cleanHierarchicalGroup
153
+ }
151
154
default :
152
155
filterGroups. removeValue ( forKey: groupID)
153
156
}
@@ -182,7 +185,7 @@ extension GroupsStorage: FiltersWritable {
182
185
}
183
186
184
187
mutating func removeAll( ) {
185
- filterGroups . removeAll ( )
188
+ removeAll ( fromGroupWithIDs : Array ( getGroupIDs ( ) ) )
186
189
}
187
190
188
191
}
Original file line number Diff line number Diff line change @@ -39,8 +39,10 @@ public extension HierarchicalInteractor {
39
39
40
40
}
41
41
42
- filterState. onChange. subscribePast ( with: interactor) { _, _ in
43
- // TODO
42
+ filterState. onChange. subscribePast ( with: interactor) { interactor, filterState in
43
+ if filterState [ hierarchical: groupName] . isEmpty {
44
+ interactor. selections = [ ]
45
+ }
44
46
}
45
47
46
48
}
You can’t perform that action at this time.
0 commit comments