Skip to content

Commit

Permalink
chore: show e2ei certificate item on debug mode only (#2415)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine authored Nov 13, 2023
1 parent c503b72 commit 5900c33
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,18 @@ fun DeviceDetailsContent(
Divider(color = MaterialTheme.wireColorScheme.background)
}
}
item {
EndToEndIdentityCertificateItem(
isE2eiCertificateActivated = state.isE2eiCertificateActivated,
certificate = state.e2eiCertificate,
isSelfClient = state.isSelfClient,
enrollE2eiCertificate = enrollE2eiCertificate,
updateE2eiCertificate = {},
showCertificate = onNavigateToE2eiCertificateDetailsScreen
)
Divider(color = colorsScheme().background)
if (BuildConfig.DEBUG) {
item {
EndToEndIdentityCertificateItem(
isE2eiCertificateActivated = state.isE2eiCertificateActivated,
certificate = state.e2eiCertificate,
isSelfClient = state.isSelfClient,
enrollE2eiCertificate = enrollE2eiCertificate,
updateE2eiCertificate = {},
showCertificate = onNavigateToE2eiCertificateDetailsScreen
)
Divider(color = colorsScheme().background)
}
}
item {
FolderHeader(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.text.input.TextFieldValue
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.appLogger
import com.wire.android.di.CurrentAccount
import com.wire.android.navigation.SavedStateViewModel
Expand Down Expand Up @@ -59,7 +60,9 @@ class DeviceDetailsViewModel @Inject constructor(
observeDeviceDetails()
getClientFingerPrint()
observeUserName()
getE2eiCertificate()
if (BuildConfig.DEBUG) {
getE2eiCertificate()
}
}

private val isSelfClient: Boolean
Expand All @@ -74,7 +77,8 @@ class DeviceDetailsViewModel @Inject constructor(
/* no-op */
}

is GetUserInfoResult.Success -> state = state.copy(userName = result.otherUser.name)
is GetUserInfoResult.Success -> state =
state.copy(userName = result.otherUser.name)
}
}
}
Expand Down Expand Up @@ -176,7 +180,10 @@ class DeviceDetailsViewModel @Inject constructor(
state
} else {
state.copy(
removeDeviceDialogState = it.copy(password = newText, removeEnabled = newText.text.isNotEmpty()),
removeDeviceDialogState = it.copy(
password = newText,
removeEnabled = newText.text.isNotEmpty()
),
error = RemoveDeviceError.None
)
}
Expand Down

0 comments on commit 5900c33

Please sign in to comment.