mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fuzzy searching debouncing (#1506)
* Add debouncer to room list fuzzy searching * Fix function_body_length violation * Filter out search query changes if fuzzy searching is not enabled
This commit is contained in:
@@ -79,14 +79,9 @@ struct HomeScreen: View {
|
||||
.onReceive(scrollViewAdapter.isScrolling) { _ in
|
||||
updateVisibleRange()
|
||||
}
|
||||
.onChange(of: context.searchQuery) { searchQuery in
|
||||
if context.viewState.fuzzySearchEnabled {
|
||||
context.send(viewAction: .updatedSearchQuery)
|
||||
} else {
|
||||
guard searchQuery.isEmpty else { return }
|
||||
// Dispatch allows the view to update after changing the query
|
||||
DispatchQueue.main.async { updateVisibleRange() }
|
||||
}
|
||||
.onChange(of: context.searchQuery) { _ in
|
||||
// Dispatch allows the view to update after changing the query
|
||||
DispatchQueue.main.async { updateVisibleRange() }
|
||||
}
|
||||
.onReceive(scrollViewAdapter.scrollDirection) { direction in
|
||||
withAnimation(.elementDefault) { lastScrollDirection = direction }
|
||||
|
||||
Reference in New Issue
Block a user