Use id to get first letter, if display name is empty
This commit is contained in:
parent
c9ed95ed21
commit
cecef5b8da
|
@ -95,9 +95,8 @@ sealed class MatrixItem(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun firstLetterOfDisplayName(): String {
|
fun firstLetterOfDisplayName(): String {
|
||||||
return displayName
|
return getBestName()
|
||||||
?.takeIf { it.isNotBlank() }
|
.let { dn ->
|
||||||
?.let { dn ->
|
|
||||||
var startIndex = 0
|
var startIndex = 0
|
||||||
val initial = dn[startIndex]
|
val initial = dn[startIndex]
|
||||||
|
|
||||||
|
@ -124,8 +123,7 @@ sealed class MatrixItem(
|
||||||
|
|
||||||
dn.substring(startIndex, startIndex + length)
|
dn.substring(startIndex, startIndex + length)
|
||||||
}
|
}
|
||||||
?.toUpperCase(Locale.ROOT)
|
.toUpperCase(Locale.ROOT)
|
||||||
?: " "
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue