-
Notifications
You must be signed in to change notification settings - Fork 738
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
Improve invite bottom sheet #4057
Conversation
vector/src/main/java/im/vector/app/features/spaces/invite/SpaceInviteBottomSheetViewModel.kt
Show resolved
Hide resolved
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.
One small remark, else LGTM
} | ||
|
||
private fun refreshInviteSummaryIfNeeded(roomSummary: RoomSummary) { | ||
if (roomSummary.membership == Membership.INVITE) { |
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.
To follow @ganfra 's remark, I would have let this if
test at the calling place (i.e. in the init {} block) to reduce indentation in the body of this method. Also the method could then be renamed to fetchRoomSummary
|
||
private fun refreshInviteSummaryIfNeeded(roomSummary: RoomSummary) { | ||
if (roomSummary.membership == Membership.INVITE) { | ||
// we can try to query the room summary api to get more info? |
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.
Remove the trailing ?
?
copy( | ||
summary = Success( | ||
roomSummary.copy( | ||
joinedMembersCount = peekResult.numJoinedMembers, |
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 have a small method to map PeekResult to RoomSummary also?
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.
Here we are copying an existing roomSummary with info from peekResult, so I think this is not applicable
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
Quick improvement of invite bottomsheet:
Whe showing an invite we try in background to query the room Summary API to get a bit more information (like the number of members). Also it could get a more up to date strippedState than the one in the room invite sync.