Skip to content
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

Merged
merged 4 commits into from
Sep 24, 2021
Merged

Conversation

BillCarsonFr
Copy link
Member

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.

image

@BillCarsonFr BillCarsonFr added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Sep 22, 2021
@github-actions
Copy link

github-actions bot commented Sep 22, 2021

Unit Test Results

  34 files  ±0    34 suites  ±0   21s ⏱️ ±0s
  73 tests ±0    73 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
180 runs  ±0  180 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit cde6e8c. ± Comparison against base commit cde6e8c.

♻️ This comment has been updated with latest results.

Copy link
Member

@bmarty bmarty left a 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) {
Copy link
Member

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?
Copy link
Member

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,
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@bmarty bmarty merged commit cde6e8c into develop Sep 24, 2021
@bmarty bmarty deleted the feature/bca/quick_invite_card_improvement branch September 24, 2021 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants