Fixes "null" strings on profile fields.
This commit is contained in:
+1
-1
@@ -1016,7 +1016,7 @@ private fun DrawAdditionalInfo(
|
|||||||
fontSize = 25.sp,
|
fontSize = 25.sp,
|
||||||
)
|
)
|
||||||
Spacer(StdHorzSpacer)
|
Spacer(StdHorzSpacer)
|
||||||
user.info?.pronouns.let {
|
user.info?.pronouns?.let {
|
||||||
Text(
|
Text(
|
||||||
text = "($it)",
|
text = "($it)",
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
|
|||||||
@@ -465,6 +465,8 @@ class UserMetadata {
|
|||||||
fun profilePicture(): String? = picture
|
fun profilePicture(): String? = picture
|
||||||
|
|
||||||
fun cleanBlankNames() {
|
fun cleanBlankNames() {
|
||||||
|
if (pronouns == "null") pronouns = null
|
||||||
|
|
||||||
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
||||||
if (nip05?.isNotEmpty() == true) nip05 = nip05?.trim()
|
if (nip05?.isNotEmpty() == true) nip05 = nip05?.trim()
|
||||||
if (displayName?.isNotEmpty() == true) displayName = displayName?.trim()
|
if (displayName?.isNotEmpty() == true) displayName = displayName?.trim()
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ class MetadataEvent(
|
|||||||
key: String,
|
key: String,
|
||||||
value: String,
|
value: String,
|
||||||
) {
|
) {
|
||||||
if (value.isBlank()) {
|
if (value.isBlank() || value == "null") {
|
||||||
currentJson.remove(key)
|
currentJson.remove(key)
|
||||||
} else {
|
} else {
|
||||||
currentJson.put(key, value.trim())
|
currentJson.put(key, value.trim())
|
||||||
|
|||||||
Reference in New Issue
Block a user