mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
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:
+6
-1
@@ -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!!
|
||||
|
||||
Reference in New Issue
Block a user