diff --git a/.idea/compiler.xml b/.idea/compiler.xml index bb5f2903..7e83cd96 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -31,6 +31,7 @@ + \ No newline at end of file diff --git a/data/src/test/kotlin/com/my/kizzy/data/KizzyRepositoryTest.kt b/data/src/test/kotlin/com/my/kizzy/data/KizzyRepositoryTest.kt index e8a79908..6188ccdb 100644 --- a/data/src/test/kotlin/com/my/kizzy/data/KizzyRepositoryTest.kt +++ b/data/src/test/kotlin/com/my/kizzy/data/KizzyRepositoryTest.kt @@ -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) } diff --git a/domain/src/main/java/com/my/kizzy/domain/model/user/User.kt b/domain/src/main/java/com/my/kizzy/domain/model/user/User.kt index 3be94129..b4d76e26 100644 --- a/domain/src/main/java/com/my/kizzy/domain/model/user/User.kt +++ b/domain/src/main/java/com/my/kizzy/domain/model/user/User.kt @@ -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) diff --git a/feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/component/ProfileCard.kt b/feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/component/ProfileCard.kt index ba232e1c..6758598f 100644 --- a/feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/component/ProfileCard.kt +++ b/feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/component/ProfileCard.kt @@ -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( diff --git a/feature_settings/src/main/java/com/my/kizzy/feature_settings/Settings.kt b/feature_settings/src/main/java/com/my/kizzy/feature_settings/Settings.kt index 0dce4e82..3e494d6e 100644 --- a/feature_settings/src/main/java/com/my/kizzy/feature_settings/Settings.kt +++ b/feature_settings/src/main/java/com/my/kizzy/feature_settings/Settings.kt @@ -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