Fix Suggestion Pattern when text is empty (#1943)

* fix + debounce improvement

* comment

* improved existing function to be more generic
This commit is contained in:
Mauro
2023-10-23 17:52:10 +02:00
committed by GitHub
parent 2f57fbc77d
commit 4c84878f88
5 changed files with 45 additions and 10 deletions
@@ -95,7 +95,7 @@ class InviteUsersScreenViewModel: InviteUsersScreenViewModelType, InviteUsersScr
private func setupSubscriptions(selectedUsers: CurrentValuePublisher<[UserProfileProxy], Never>) {
context.$viewState
.map(\.bindings.searchQuery)
.debounceAndRemoveDuplicates()
.debounceTextQueriesAndRemoveDuplicates()
.sink { [weak self] _ in
self?.fetchUsers()
}