Fix mapping issue.
This commit is contained in:
parent
ef29c4ba97
commit
7aa79b6434
3 changed files with 16 additions and 9 deletions
|
|
@ -155,7 +155,7 @@ class IncomingVerificationPresenter(
|
||||||
StateMachineState.RejectingIncomingVerification,
|
StateMachineState.RejectingIncomingVerification,
|
||||||
null -> {
|
null -> {
|
||||||
Step.Initial(
|
Step.Initial(
|
||||||
deviceDisplayName = sessionVerificationRequestDetails.senderProfile.displayName ?: sessionVerificationRequestDetails.deviceId.value,
|
deviceDisplayName = sessionVerificationRequestDetails.deviceDisplayName,
|
||||||
deviceId = sessionVerificationRequestDetails.deviceId,
|
deviceId = sessionVerificationRequestDetails.deviceId,
|
||||||
formattedSignInTime = formattedSignInTime,
|
formattedSignInTime = formattedSignInTime,
|
||||||
isWaiting = machineState == StateMachineState.AcceptingIncomingVerification ||
|
isWaiting = machineState == StateMachineState.AcceptingIncomingVerification ||
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ data class IncomingVerificationState(
|
||||||
@Stable
|
@Stable
|
||||||
sealed interface Step {
|
sealed interface Step {
|
||||||
data class Initial(
|
data class Initial(
|
||||||
val deviceDisplayName: String,
|
val deviceDisplayName: String?,
|
||||||
val deviceId: DeviceId,
|
val deviceId: DeviceId,
|
||||||
val formattedSignInTime: String,
|
val formattedSignInTime: String,
|
||||||
val isWaiting: Boolean,
|
val isWaiting: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SessionDetailsView(
|
fun SessionDetailsView(
|
||||||
deviceName: String,
|
deviceName: String?,
|
||||||
deviceId: DeviceId,
|
deviceId: DeviceId,
|
||||||
signInFormattedTimestamp: String,
|
signInFormattedTimestamp: String,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
|
@ -61,7 +61,7 @@ fun SessionDetailsView(
|
||||||
resourceId = CompoundDrawables.ic_compound_devices
|
resourceId = CompoundDrawables.ic_compound_devices
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = deviceName,
|
text = deviceName ?: deviceId.value,
|
||||||
style = ElementTheme.typography.fontBodyMdMedium,
|
style = ElementTheme.typography.fontBodyMdMedium,
|
||||||
color = ElementTheme.colors.textPrimary,
|
color = ElementTheme.colors.textPrimary,
|
||||||
)
|
)
|
||||||
|
|
@ -87,9 +87,16 @@ fun SessionDetailsView(
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun SessionDetailsViewPreview() = ElementPreview {
|
internal fun SessionDetailsViewPreview() = ElementPreview {
|
||||||
SessionDetailsView(
|
Column {
|
||||||
deviceName = "Element X Android",
|
SessionDetailsView(
|
||||||
deviceId = DeviceId("ILAKNDNASDLK"),
|
deviceName = "Element X Android",
|
||||||
signInFormattedTimestamp = "12:34",
|
deviceId = DeviceId("ILAKNDNASDLK"),
|
||||||
)
|
signInFormattedTimestamp = "12:34",
|
||||||
|
)
|
||||||
|
SessionDetailsView(
|
||||||
|
deviceName = null,
|
||||||
|
deviceId = DeviceId("ILAKNDNASDLK"),
|
||||||
|
signInFormattedTimestamp = "12:34",
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue