diff --git a/changelog.d/5827.bugfix b/changelog.d/5827.bugfix new file mode 100644 index 0000000000..0bd55e33ec --- /dev/null +++ b/changelog.d/5827.bugfix @@ -0,0 +1 @@ +Do not switch away from home space on notification when "Show all Rooms in Home" is selected. diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt index b79b55b248..1c55da2656 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt @@ -207,7 +207,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