Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ private fun ColumnScope.DeviceItemTexts(
.then(semantic)
)
if (shouldShowVerifyLabel) {
if (shouldShowE2EIInfo) {
MLSVerificationIcon(device.mlsClientIdentity?.e2eiStatus)
if (shouldShowE2EIInfo && device.mlsClientIdentity != null) {
MLSVerificationIcon(device.mlsClientIdentity.e2eiStatus)
}
if (device.isVerifiedProteus && !isCurrentClient) {
ProteusVerifiedIcon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ fun DeviceDetailsContent(
}
}

if (state.isE2EIEnabled) {
if (state.isE2EIEnabled && state.isE2eiCertificateDataAvailable) {
item {
EndToEndIdentityCertificateItem(
isE2eiCertificateActivated = state.isE2eiCertificateActivated,
Expand Down Expand Up @@ -363,8 +363,8 @@ private fun DeviceDetailsTopBar(
maxLines = 2
)

if (shouldShowE2EIInfo) {
MLSVerificationIcon(device.mlsClientIdentity?.e2eiStatus)
if (shouldShowE2EIInfo && device.mlsClientIdentity != null) {
MLSVerificationIcon(device.mlsClientIdentity.e2eiStatus)
}

if (!isCurrentDevice && device.isVerifiedProteus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ class DeviceDetailsViewModel @Inject constructor(
private fun getE2eiCertificate() {
viewModelScope.launch {
state = when (val result = mlsClientIdentity(deviceId)) {
is GetMLSClientIdentityResult.Failure.E2EINotAvailable -> {
state.copy(
isE2eiCertificateActivated = false,
isLoadingCertificate = false,
isE2eiCertificateDataAvailable = false
)
}
is GetMLSClientIdentityResult.Failure -> {
state.copy(isE2eiCertificateActivated = false, isLoadingCertificate = false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ data class DeviceDetailsState(
val startGettingE2EICertificate: Boolean = false,
val mlsCipherSuiteSignature: String? = null,
val deviceRemoved: Boolean = false,
val isE2eiCertificateDataAvailable: Boolean = true,
)
Loading