From 39e8289375137b8db1c010eb1ca58d4303bd707f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 22 Feb 2023 09:58:09 -0500 Subject: [PATCH] Renders invalid tags as is. Should stop crashing in notifications. --- .../amethyst/ui/components/RichTextViewer.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt index 856f3a7ee..9fb65f58e 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt @@ -183,10 +183,11 @@ fun TagLink(word: String, tags: List>, accountViewModel: AccountVie if (user != null) { ClickableUserTag(user, navController) } else { - Text(text = "${tags[index][1].toByteArray().toNpub().toShortenHex()} ") + Text(text = "$word ") } } else { - Text(text = "${tags[index][1].toByteArray().toNpub().toShortenHex()} ") + // if here the tag is not a valid Nostr Hex + Text(text = "$word ") } } else if (tags[index][0] == "e") { val note = LocalCache.checkGetOrCreateNote(tags[index][1]) @@ -208,11 +209,10 @@ fun TagLink(word: String, tags: List>, accountViewModel: AccountVie isQuotedNote = true, navController = navController) } else { - Text(text = "${tags[index][1].toByteArray().toNote().toShortenHex()} ") + // if here the tag is not a valid Nostr Hex + Text(text = "$word ") } } else Text(text = "$word ") } } - -