mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 15:26:15 +00:00
Drop the comments from the filter selection guard
Review feedback: the guard and the test name already say what the check is for, so the narration was redundant.
This commit is contained in:
-4
@@ -22,10 +22,6 @@ class DefaultFilterSelectionStrategy : FilterSelectionStrategy {
|
|||||||
override val filterSelectionStates = MutableStateFlow(buildFilters())
|
override val filterSelectionStates = MutableStateFlow(buildFilters())
|
||||||
|
|
||||||
override fun select(filter: RoomListFilter) {
|
override fun select(filter: RoomListFilter) {
|
||||||
// Incompatible filters are hidden from the UI rather than disabled, so a filter can still be
|
|
||||||
// selected while its chip is on its way out, typically when two chips are tapped in the same
|
|
||||||
// frame. Ignore it, the currently applied filters win.
|
|
||||||
// See https://github.com/element-hq/element-x-android/issues/5383
|
|
||||||
if (selectedFilters.any { it in filter.incompatibleFilters }) return
|
if (selectedFilters.any { it in filter.incompatibleFilters }) return
|
||||||
selectedFilters.add(filter)
|
selectedFilters.add(filter)
|
||||||
filterSelectionStates.value = buildFilters()
|
filterSelectionStates.value = buildFilters()
|
||||||
|
|||||||
-2
@@ -78,8 +78,6 @@ class RoomListFiltersPresenterTest {
|
|||||||
val presenter = createRoomListFiltersPresenter()
|
val presenter = createRoomListFiltersPresenter()
|
||||||
presenter.test {
|
presenter.test {
|
||||||
awaitItem().let { state ->
|
awaitItem().let { state ->
|
||||||
// Both events are sent on the same state, i.e. before any recomposition, which is what
|
|
||||||
// happens when the two chips are tapped simultaneously.
|
|
||||||
state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Favourites))
|
state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Favourites))
|
||||||
state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Invites))
|
state.eventSink.invoke(RoomListFiltersEvent.ToggleFilter(RoomListFilter.Invites))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user