mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix incorrect visible room ranges: correctly remove duplicates and ignore appearance changes while filtering
This commit is contained in:
committed by
Stefan Ceriu
parent
9fe81d977c
commit
cc6201ed31
@@ -179,8 +179,8 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
|
||||
visibleItemRangeObservationToken = visibleItemRangePublisher
|
||||
.removeDuplicates(by: { $0.isScrolling == $1.isScrolling && $0.range == $1.range })
|
||||
.throttle(for: 0.5, scheduler: DispatchQueue.main, latest: true)
|
||||
.removeDuplicates(by: { $0.isScrolling == $1.isScrolling && $0.range == $1.range })
|
||||
.sink { [weak self] value in
|
||||
guard let self else { return }
|
||||
|
||||
|
||||
@@ -54,9 +54,13 @@ struct HomeScreen: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
// Ignore while filtering rooms
|
||||
guard context.searchQuery.isEmpty else { return }
|
||||
visibleItemIdentifiers.insert(room.id)
|
||||
}
|
||||
.onDisappear {
|
||||
// Ignore while filtering rooms
|
||||
guard context.searchQuery.isEmpty else { return }
|
||||
visibleItemIdentifiers.remove(room.id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Fix incorrect visible room ranges: correctly remove duplicates and ignore appearance changes while filtering
|
||||
Reference in New Issue
Block a user