Skip to content

Commit f2cdf06

Browse files
committed
fix(ui): leave an avatar with no name as the bare gradient
InitialsText fell back to "?" when the name had no letters. It now draws nothing, matching iOS, which shows only the gradient.
1 parent 08872db commit f2cdf06

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • apps/flipcash/shared/common-ui/src/main/kotlin/com/flipcash/shared/common/ui

‎apps/flipcash/shared/common-ui/src/main/kotlin/com/flipcash/shared/common/ui/ContactAvatar.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ private fun BoxWithConstraintsScope.InitialsText(displayName: String) {
331331
.take(2)
332332
.mapNotNull { it.firstOrNull()?.uppercaseChar() }
333333
.joinToString("")
334-
.ifEmpty { "?" }
335334
}
335+
// A name with no letters leaves the gradient on its own, as iOS does, rather than a "?".
336+
if (initials.isEmpty()) return
336337
val fontSize = with(LocalDensity.current) {
337338
(min(maxWidth, maxHeight) * 0.38f).toSp()
338339
}

0 commit comments

Comments
 (0)