Skip to content

Commit 3631f35

Browse files
Simplify logic
1 parent db3f1a1 commit 3631f35

File tree

1 file changed

+3
-3
lines changed
  • WooCommerce/src/main/kotlin/com/woocommerce/android/model

1 file changed

+3
-3
lines changed

WooCommerce/src/main/kotlin/com/woocommerce/android/model/User.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ data class User(
1616
fun getUserNameForDisplay(): String {
1717
val name = "$firstName $lastName".trim()
1818
return when {
19-
name.isEmpty() && username.isEmpty() -> email
20-
name.isEmpty() && username.isNotEmpty() -> username
21-
else -> name
19+
name.isNotEmpty() -> name
20+
username.isNotEmpty() -> username
21+
else -> email
2222
}
2323
}
2424
}

0 commit comments

Comments
 (0)