Skip to content

Commit

Permalink
fix: handle mls disabled error [WPB-15022] (#3745)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garzas authored Dec 16, 2024
1 parent 90282ea commit 0f6eeb5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ class DebugDataOptionsViewModelImpl
}

is MLSKeyPackageCountResult.Failure.Generic -> {}
MLSKeyPackageCountResult.Failure.NotEnabled -> {
state = state.copy(mlsErrorMessage = "Not Enabled!")
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class DeviceDetailsViewModelTest {
updateClientVerificationStatus = updateClientVerificationStatus,
currentUserId = currentUserId,
observeUserInfo = observeUserInfo,
e2eiCertificate = getE2eiCertificate,
mlsClientIdentity = getE2eiCertificate,
isE2EIEnabledUseCase = isE2EIEnabledUseCase,
breakSession = breakSession
)
Expand Down

0 comments on commit 0f6eeb5

Please sign in to comment.