Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dead8309 committed Oct 7, 2023
2 parents f55f8b9 + b4e9916 commit c8bbe2e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class KizzyRepositoryTest {
@Test
fun `Get a User Through Api`() = runBlocking {
val user = kizzyRepository.getUser("888890990956511263")
assert(user.username == "yzziK")
assert(user.username == "yzzik")
assert(user.verified)
}

Expand Down
4 changes: 3 additions & 1 deletion domain/src/main/java/com/my/kizzy/domain/model/user/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ data class User(
@SerialName("special")
val special: String? = null,
@SerialName("verified")
val verified: Boolean = false
val verified: Boolean = false,
@SerialName("global_name")
val globalName: String? = null
) {
fun getAvatarImage(): String {
return if (avatar?.startsWith("a_") == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fun ProfileCard(
.background(Color.White)
) {
ProfileText(
text = user.username + "#" + user.discriminator,
text = user.globalName ?: (user.username + "#" + user.discriminator),
style = MaterialTheme.typography.titleLarge,
)
Spacer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fun ProfileCardSmall(
modifier = Modifier
.weight(9f)
.padding(5.dp),
text = user?.username+"#"+user?.discriminator,
text = user?.globalName ?: (user?.username + "#" + user?.discriminator),
maxLines = 1,
style = MaterialTheme.typography.titleLarge.copy(fontSize = 20.sp, fontWeight = FontWeight.SemiBold),
overflow = TextOverflow.Ellipsis
Expand Down

0 comments on commit c8bbe2e

Please sign in to comment.