mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Revert "Remove fuzzy searching entirely because of performance issues"
This reverts commit e86f65ad2d.
This commit is contained in:
committed by
Stefan Ceriu
parent
65256bf4ab
commit
ff074e3fae
@@ -49,7 +49,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
roomSummaryProvider = userSession.clientProxy.roomSummaryProvider
|
||||
inviteSummaryProvider = userSession.clientProxy.inviteSummaryProvider
|
||||
|
||||
super.init(initialViewState: HomeScreenViewState(userID: userSession.userID),
|
||||
super.init(initialViewState: HomeScreenViewState(userID: userSession.userID, fuzzySearchEnabled: appSettings.fuzzySearchEnabled),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
|
||||
userSession.callbacks
|
||||
@@ -74,6 +74,19 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
.weakAssign(to: \.state.selectedRoomID, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
appSettings.$fuzzySearchEnabled
|
||||
.weakAssign(to: \.state.fuzzySearchEnabled, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
context.$viewState
|
||||
.filter { _ in appSettings.fuzzySearchEnabled }
|
||||
.map(\.bindings.searchQuery)
|
||||
.debounceAndRemoveDuplicates()
|
||||
.sink { [weak self] searchQuery in
|
||||
self?.roomSummaryProvider?.updateFilterPattern(searchQuery)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
setupRoomSummaryProviderSubscriptions()
|
||||
|
||||
updateRooms()
|
||||
|
||||
Reference in New Issue
Block a user