From 459f9b93d760e80afb6e66ececc33df0004d3c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BBerko?= Date: Mon, 16 Dec 2024 16:57:05 +0100 Subject: [PATCH] fix: handle mls disabled error --- .../com/wire/android/ui/debug/DebugDataOptionsViewModel.kt | 3 +++ .../android/ui/settings/devices/DeviceDetailsViewModel.kt | 4 ++-- .../android/ui/settings/devices/DeviceDetailsViewModelTest.kt | 2 +- kalium | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt index e98c20eb903..27fdf191eb9 100644 --- a/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/debug/DebugDataOptionsViewModel.kt @@ -304,6 +304,9 @@ class DebugDataOptionsViewModelImpl } is MLSKeyPackageCountResult.Failure.Generic -> {} + MLSKeyPackageCountResult.Failure.NotEnabled -> { + state = state.copy(mlsErrorMessage = "Not Enabled!") + } } } } diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt index 826154cc6b6..1ca4096174f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt @@ -73,7 +73,7 @@ class DeviceDetailsViewModel @Inject constructor( private val fingerprintUseCase: ClientFingerprintUseCase, private val updateClientVerificationStatus: UpdateClientVerificationStatusUseCase, private val observeUserInfo: ObserveUserInfoUseCase, - private val e2eiCertificate: GetMLSClientIdentityUseCase, + private val mlsClientIdentity: GetMLSClientIdentityUseCase, private val breakSession: BreakSessionUseCase, isE2EIEnabledUseCase: IsE2EIEnabledUseCase ) : SavedStateViewModel(savedStateHandle) { @@ -134,7 +134,7 @@ class DeviceDetailsViewModel @Inject constructor( private fun getE2eiCertificate() { viewModelScope.launch { - state = e2eiCertificate(deviceId).fold({ + state = mlsClientIdentity(deviceId).fold({ state.copy(isE2eiCertificateActivated = false, isLoadingCertificate = false) }, { mlsClientIdentity -> state.copy( diff --git a/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt index 6b69dabbd6e..5e0ea113b3a 100644 --- a/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt @@ -377,7 +377,7 @@ class DeviceDetailsViewModelTest { updateClientVerificationStatus = updateClientVerificationStatus, currentUserId = currentUserId, observeUserInfo = observeUserInfo, - e2eiCertificate = getE2eiCertificate, + mlsClientIdentity = getE2eiCertificate, isE2EIEnabledUseCase = isE2EIEnabledUseCase, breakSession = breakSession ) diff --git a/kalium b/kalium index 0667f9b780a..9926d3dc47c 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 0667f9b780a8262768b0c37af3d49d4f83c55701 +Subproject commit 9926d3dc47c1a238dfd9c292095fbb4ededf81ba