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 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 descriptionDrawable = if (device.isInactive) host.drawableProvider.getDrawable(R.drawable.ic_inactive_sessions, drawableColor) else null
val sessionName = device.deviceInfo.displayName ?: device.deviceInfo.deviceId
otherSessionItem { otherSessionItem {
id(device.deviceInfo.deviceId) id(device.deviceInfo.deviceId)
deviceType(device.deviceExtendedInfo.deviceType) deviceType(device.deviceExtendedInfo.deviceType)
roomEncryptionTrustLevel(device.roomEncryptionTrustLevel) roomEncryptionTrustLevel(device.roomEncryptionTrustLevel)
sessionName(device.deviceInfo.displayName) sessionName(sessionName)
sessionDescription(description) sessionDescription(description)
sessionDescriptionDrawable(descriptionDrawable) sessionDescriptionDrawable(descriptionDrawable)
sessionDescriptionColor(descriptionColor) sessionDescriptionColor(descriptionColor)

View File

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