diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt index 4121ff9ab4..9b5951ae3d 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/filters/selection/DefaultFilterSelectionStrategy.kt @@ -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() diff --git a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt index ae1d7b5083..02d947613f 100644 --- a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt +++ b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/filters/RoomListFiltersPresenterTest.kt @@ -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)) }