Merge pull request #7785 from vector-im/fix/mna/hide-filter-in-selection-mode

[Session manager] Other sessions list: filter option is displayed when selection mode is enabled (PSG-1113)
This commit is contained in:
Maxime NATUREL 2022-12-19 14:11:37 +01:00 committed by GitHub
commit ef7b5a4418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

1
changelog.d/7784.bugfix Normal file
View File

@ -0,0 +1 @@
[Session manager] Other sessions list: filter option is displayed when selection mode is enabled

View File

@ -225,6 +225,7 @@ class OtherSessionsFragment :
override fun invalidate() = withState(viewModel) { state ->
updateLoading(state.isLoading)
updateFilterView(state.isSelectModeEnabled)
if (state.devices is Success) {
val devices = state.devices.invoke()
renderDevices(devices, state.currentFilter, state.isShowingIpAddress)
@ -240,6 +241,10 @@ class OtherSessionsFragment :
}
}
private fun updateFilterView(isSelectModeEnabled: Boolean) {
views.otherSessionsFilterFrameLayout.isVisible = isSelectModeEnabled.not()
}
private fun updateToolbar(devices: List<DeviceFullInfo>, isSelectModeEnabled: Boolean) {
invalidateOptionsMenu()
val title = if (isSelectModeEnabled) {