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:
hayaksi1
2026-08-09 14:46:13 +03:00
parent e8ca16b74f
commit 8943c4e724
2 changed files with 0 additions and 6 deletions
@@ -22,10 +22,6 @@ class DefaultFilterSelectionStrategy : FilterSelectionStrategy {
override val filterSelectionStates = MutableStateFlow(buildFilters())
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
selectedFilters.add(filter)
filterSelectionStates.value = buildFilters()
@@ -78,8 +78,6 @@ class RoomListFiltersPresenterTest {
val presenter = createRoomListFiltersPresenter()
presenter.test {
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.Invites))
}