Close detail room screen when the room is left with another client (#256)

This commit is contained in:
Benoit Marty 2019-07-19 16:00:06 +02:00
parent cd6624a8a6
commit 10490e3aa6
2 changed files with 9 additions and 3 deletions

View File

@ -12,6 +12,7 @@ Other changes:

Bugfix:
- Edited message: link confusion when (edited) appears in body (#398)
- Close detail room screen when the room is left with another client (#256)

Translations:
-

View File

@ -536,9 +536,14 @@ class RoomDetailFragment :

private fun renderRoomSummary(state: RoomDetailViewState) {
state.asyncRoomSummary()?.let {
roomToolbarTitleView.text = it.displayName
avatarRenderer.render(it, roomToolbarAvatarImageView)
roomToolbarSubtitleView.setTextOrHide(it.topic)
if (it.membership.isLeft()) {
Timber.w("The room has been left")
activity?.finish()
} else {
roomToolbarTitleView.text = it.displayName
avatarRenderer.render(it, roomToolbarAvatarImageView)
roomToolbarSubtitleView.setTextOrHide(it.topic)
}
}
}