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
@@ -47,6 +47,7 @@ enum HomeScreenViewAction {
case skipSessionVerification
case updateVisibleItemRange(range: Range<Int>, isScrolling: Bool)
case selectInvites
case updatedSearchQuery
}
enum HomeScreenRoomListMode: CustomStringConvertible {
@@ -84,11 +85,7 @@ struct HomeScreenViewState: BindableState {
return placeholderRooms
}
if bindings.searchQuery.isEmpty {
return rooms
}
return rooms.filter { $0.name.localizedStandardContains(bindings.searchQuery) }
return rooms
}
var bindings = HomeScreenViewStateBindings()