Improve permission label display in IntentMultiEventHomeScreen

Update `IntentMultiEventHomeScreen` to use the "alt" tag value as a label when a `SIGN_EVENT` request has an unknown event kind. This provides more descriptive information to the user when the standard localized string for a kind is unavailable.
This commit is contained in:
greenart7c3
2026-04-10 10:43:53 -03:00
parent 7042ba5c4e
commit ebc62bb1ae
@@ -535,7 +535,7 @@ private fun IntentRequestCard(
Permission(type.toString().toLowerCase(Locale.current), null)
}
val label = if (type == SignerType.CONNECT) {
var label = if (type == SignerType.CONNECT) {
stringResource(R.string.connect)
} else {
val encryptedData = intent.encryptedData
@@ -568,6 +568,11 @@ private fun IntentRequestCard(
permission.toLocalizedString(context)
}
}
val unknownKindString = stringResource(R.string.event_kind, permission.kind?.toString() ?: "")
if (label == unknownKindString && type == SignerType.SIGN_EVENT) {
val altTag = intent.event?.tags?.firstOrNull { it.size > 1 && it[0] == "alt" }?.getOrNull(1)
label = altTag ?: label
}
val preview = if (type == SignerType.SIGN_EVENT) {
val event = intent.event!!