Merge pull request #4219 from element-hq/feature/bma/encryptionBadge
Always display encryption badge
This commit is contained in:
commit
be22163785
4 changed files with 12 additions and 12 deletions
|
|
@ -48,12 +48,10 @@ data class RoomDetailsState(
|
||||||
val eventSink: (RoomDetailsEvent) -> Unit
|
val eventSink: (RoomDetailsEvent) -> Unit
|
||||||
) {
|
) {
|
||||||
val roomBadges = buildList {
|
val roomBadges = buildList {
|
||||||
if (isEncrypted || isPublic) {
|
if (isEncrypted) {
|
||||||
if (isEncrypted) {
|
add(RoomBadge.ENCRYPTED)
|
||||||
add(RoomBadge.ENCRYPTED)
|
} else {
|
||||||
} else {
|
add(RoomBadge.NOT_ENCRYPTED)
|
||||||
add(RoomBadge.NOT_ENCRYPTED)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isPublic) {
|
if (isPublic) {
|
||||||
add(RoomBadge.PUBLIC)
|
add(RoomBadge.PUBLIC)
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,14 @@ import org.junit.Test
|
||||||
|
|
||||||
class RoomDetailsStateTest {
|
class RoomDetailsStateTest {
|
||||||
@Test
|
@Test
|
||||||
fun `room not public not encrypted should have no badges`() {
|
fun `room not public not encrypted should have not encrypted badge`() {
|
||||||
val sut = aRoomDetailsState(
|
val sut = aRoomDetailsState(
|
||||||
isPublic = false,
|
isPublic = false,
|
||||||
isEncrypted = false,
|
isEncrypted = false,
|
||||||
)
|
)
|
||||||
assertThat(sut.roomBadges).isEmpty()
|
assertThat(sut.roomBadges).isEqualTo(
|
||||||
|
persistentListOf(RoomBadge.NOT_ENCRYPTED)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c1dd220efe1e2b30ebc14e10bb359b97a7be9c9d25c35e339ad74384a18150a2
|
oid sha256:6fc7dc287c5da18ee2a7f8fdadf91285f6e9ed7a8328515cbfd6f90b21642794
|
||||||
size 42675
|
size 42190
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:c93a5ad4c336ea01f6f17ce17c6c933066c2298c587b3db9bf24eff48c286f4d
|
oid sha256:787945a9d09f405aa8ae2efe88b40cf61b07e21b402e6d842723378ff7d0a001
|
||||||
size 44073
|
size 43242
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue