-
Notifications
You must be signed in to change notification settings - Fork 860
Home always showing all rooms
#6666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…lter param - we were passing null which meant no filter was being applied
bmarty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
| this.spaceFilter = SpaceFilter.OrphanRooms.takeIf { | ||
| !vectorPreferences.prefSpacesShowAllRoomInHome() | ||
| } | ||
| } ?: SpaceFilter.NoFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I think a if/else would be clearer:
if (vectorPreferences.prefSpacesShowAllRoomInHome()) {
SpaceFilter.NoFilter
} else {
SpaceFilter.OrphanRooms
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, will update 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.spaceFilter = SpaceFilter.OrphanRooms.takeIf { | ||
| !vectorPreferences.prefSpacesShowAllRoomInHome() | ||
| } | ||
| } ?: SpaceFilter.NoFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark
| this.spaceFilter = SpaceFilter.OrphanRooms.takeIf { | ||
| !vectorPreferences.prefSpacesShowAllRoomInHome() | ||
| } | ||
| } ?: SpaceFilter.NoFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark
| * Used to filter room using the current space. | ||
| */ | ||
| val spaceFilter: SpaceFilter?, | ||
| val spaceFilter: SpaceFilter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention this API change in a file 6666.sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| .onEach { selectedSpaceOption -> | ||
| val selectedSpace = selectedSpaceOption.orNull() | ||
| val strategy = if (!vectorPreferences.prefSpacesShowAllRoomInHome()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @fedrunov this condition looked inverted and has been updated to match the usages in other screens
when {
vectorPreferences.prefSpacesShowAllRoomInHome() -> selectedSpaceId.toActiveSpaceOrNoFilter()
else -> selectedSpaceId.toActiveSpaceOrOrphanRooms()
}
bmarty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the update.
| .launchIn(viewModelScope) | ||
| } | ||
|
|
||
| private fun roomsInSpaceFilter() = when { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change it now, but the fun name is a bit strange to me.
Maybe something like getSpaceFilter() would be better.
On the fund, I do not really get why we have such filter here, since IIUC this ViewModel is used by the screen which displays only Spaces. So having orphans rooms here is strange to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK, it's to update the notification count. Please ignore me!
|
going to skip waiting for the instrumentation tests to complete so that the RC process can start |
|
SonarCloud Quality Gate failed. |








Type of change
Content
toActiveSpaceOrOrphanRoomsusages to avoid the nullsafe fallback, the extension already handles the null case for us (this is the fix!)SpaceFilterin favour of a dedicatedNoFiltertype, should help address the ambiguity of the different statesMotivation and context
Fixes #6665
Screenshots / GIFs
Tests
Show all rooms in Homepreference has no effectTested devices