mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Fixes "null" strings on profile fields.
This commit is contained in:
parent
88082b1ba3
commit
9a0c998654
@ -1016,7 +1016,7 @@ private fun DrawAdditionalInfo(
|
||||
fontSize = 25.sp,
|
||||
)
|
||||
Spacer(StdHorzSpacer)
|
||||
user.info?.pronouns.let {
|
||||
user.info?.pronouns?.let {
|
||||
Text(
|
||||
text = "($it)",
|
||||
modifier = Modifier,
|
||||
|
@ -465,6 +465,8 @@ class UserMetadata {
|
||||
fun profilePicture(): String? = picture
|
||||
|
||||
fun cleanBlankNames() {
|
||||
if (pronouns == "null") pronouns = null
|
||||
|
||||
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
||||
if (nip05?.isNotEmpty() == true) nip05 = nip05?.trim()
|
||||
if (displayName?.isNotEmpty() == true) displayName = displayName?.trim()
|
||||
|
@ -283,7 +283,7 @@ class MetadataEvent(
|
||||
key: String,
|
||||
value: String,
|
||||
) {
|
||||
if (value.isBlank()) {
|
||||
if (value.isBlank() || value == "null") {
|
||||
currentJson.remove(key)
|
||||
} else {
|
||||
currentJson.put(key, value.trim())
|
||||
|
Loading…
x
Reference in New Issue
Block a user