mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-28 01:40:47 -04:00
Fix unit test for the empty name case
This commit is contained in:
@@ -35,7 +35,10 @@ fun getInitials(nameIn: String): String {
|
||||
|
||||
val initials = when (words.size) {
|
||||
in 0..minchars - 1 -> {
|
||||
val nm = name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
|
||||
val nm = if (name.length >= 1)
|
||||
name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
|
||||
else
|
||||
""
|
||||
if (nm.length >= nchars) nm else name
|
||||
}
|
||||
else -> words.map { it.first() }.joinToString("")
|
||||
|
||||
Reference in New Issue
Block a user