Use deviceId as session name when there is no display name

This commit is contained in:
Maxime NATUREL 2022-12-27 16:41:25 +01:00 committed by Maxime NATUREL
parent 01429b352a
commit 1af712910f
2 changed files with 6 additions and 4 deletions

View File

@ -63,12 +63,13 @@ class OtherSessionsController @Inject constructor(
}
val drawableColor = host.colorProvider.getColorFromAttribute(R.attr.vctr_content_secondary)
val descriptionDrawable = if (device.isInactive) host.drawableProvider.getDrawable(R.drawable.ic_inactive_sessions, drawableColor) else null
val sessionName = device.deviceInfo.displayName ?: device.deviceInfo.deviceId
otherSessionItem {
id(device.deviceInfo.deviceId)
deviceType(device.deviceExtendedInfo.deviceType)
roomEncryptionTrustLevel(device.roomEncryptionTrustLevel)
sessionName(device.deviceInfo.displayName)
sessionName(sessionName)
sessionDescription(description)
sessionDescriptionDrawable(descriptionDrawable)
sessionDescriptionColor(descriptionColor)

View File

@ -62,9 +62,10 @@ class SessionInfoView @JvmOverloads constructor(
stringProvider: StringProvider,
) {
renderDeviceInfo(
sessionInfoViewState.deviceFullInfo.deviceInfo.displayName.orEmpty(),
sessionInfoViewState.deviceFullInfo.deviceExtendedInfo.deviceType,
stringProvider,
sessionName = sessionInfoViewState.deviceFullInfo.deviceInfo.displayName
?: sessionInfoViewState.deviceFullInfo.deviceInfo.deviceId.orEmpty(),
deviceType = sessionInfoViewState.deviceFullInfo.deviceExtendedInfo.deviceType,
stringProvider = stringProvider,
)
renderVerificationStatus(
sessionInfoViewState.deviceFullInfo.roomEncryptionTrustLevel,