Adopt fuzzy searching through the RoomListService's dynamic filter

This commit is contained in:
Stefan Ceriu
2023-08-11 17:26:45 +03:00
committed by Stefan Ceriu
parent 4503e6e0cc
commit e13e97400b
7 changed files with 27 additions and 16 deletions
@@ -79,8 +79,9 @@ struct HomeScreen: View {
.onReceive(scrollViewAdapter.isScrolling) { _ in
updateVisibleRange()
}
.onChange(of: context.searchQuery) { searchQuery in
guard searchQuery.isEmpty else { return }
.onChange(of: context.searchQuery) { _ in
context.send(viewAction: .updatedSearchQuery)
// Dispatch allows the view to update after changing the query
DispatchQueue.main.async { updateVisibleRange() }
}