Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle mls disabled error [WPB-15022] #3745

Merged
merged 3 commits into from
Dec 16, 2024
Merged
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 @@ -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
Loading