mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 21:48:50 +03:00
Use id to get first letter, if display name is empty
This commit is contained in:
parent
c9ed95ed21
commit
cecef5b8da
1 changed files with 3 additions and 5 deletions
|
@ -95,9 +95,8 @@ sealed class MatrixItem(
|
|||
}
|
||||
|
||||
fun firstLetterOfDisplayName(): String {
|
||||
return displayName
|
||||
?.takeIf { it.isNotBlank() }
|
||||
?.let { dn ->
|
||||
return getBestName()
|
||||
.let { dn ->
|
||||
var startIndex = 0
|
||||
val initial = dn[startIndex]
|
||||
|
||||
|
@ -124,8 +123,7 @@ sealed class MatrixItem(
|
|||
|
||||
dn.substring(startIndex, startIndex + length)
|
||||
}
|
||||
?.toUpperCase(Locale.ROOT)
|
||||
?: " "
|
||||
.toUpperCase(Locale.ROOT)
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue