Centralise the NIP-05 wildcard check (name != "_") on the data class itself.

This commit is contained in:
davotoula
2026-05-06 17:28:36 +02:00
parent d2e04a6726
commit fe2cb7da66
5 changed files with 24 additions and 4 deletions
@@ -378,7 +378,7 @@ fun ObserveAndDisplayNIP05(
) {
val uri = LocalUriHandler.current
if (nip05State.nip05.name != "_") {
if (nip05State.nip05.hasLocalPart()) {
Text(
text = remember(nip05State) { AnnotatedString(nip05State.nip05.name) },
fontSize = Font14SP,
@@ -407,7 +407,7 @@ fun DisplayNIP05(
) {
val uri = LocalUriHandler.current
if (nip05State.nip05.name != "_") {
if (nip05State.nip05.hasLocalPart()) {
Text(
text = remember(nip05State) { AnnotatedString(nip05State.nip05.name) },
fontSize = Font14SP,
@@ -188,7 +188,7 @@ private fun NonClickableObserveAndDisplayNIP05(
nip05State: Nip05State.Exists,
accountViewModel: AccountViewModel,
) {
if (nip05State.nip05.name != "_") {
if (nip05State.nip05.hasLocalPart()) {
Text(
text = remember(nip05State) { AnnotatedString(nip05State.nip05.name) },
fontSize = Font14SP,
@@ -490,7 +490,7 @@ private fun PubkeyNip05Row(
when (val nip05State = nip05StateMetadata) {
is Nip05State.Exists -> {
if (nip05State.nip05.name != "_") {
if (nip05State.nip05.hasLocalPart()) {
Text(
text = remember(nip05State) { AnnotatedString(nip05State.nip05.name) },
fontSize = Font14SP,