Merge pull request #5827 from mikonse/fix-notification-space-switch

do not switch away from home space on notification
This commit is contained in:
Benoit Marty 2022-05-31 16:34:47 +02:00 committed by GitHub
commit 5b985dc032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

1
changelog.d/5827.bugfix Normal file
View file

@ -0,0 +1 @@
Do not switch away from home space on notification when "Show all Rooms in Home" is selected.

View file

@ -211,7 +211,8 @@ class TimelineViewModel @AssistedInject constructor(
appStateHandler.getCurrentRoomGroupingMethod()?.space().let { currentSpace ->
val currentRoomSummary = room.roomSummary() ?: return@let
// nothing we are good
if (currentSpace == null || !currentRoomSummary.flattenParentIds.contains(currentSpace.roomId)) {
if ((currentSpace == null && !vectorPreferences.prefSpacesShowAllRoomInHome())
|| (currentSpace != null && !currentRoomSummary.flattenParentIds.contains(currentSpace.roomId))) {
// take first one or switch to home
appStateHandler.setCurrentSpace(
currentRoomSummary