Merge pull request #2442 from vitorpamplona/claude/hide-payment-targets-button-tDYK9

Simplify payment button logic and handle empty targets earlier
This commit is contained in:
Vitor Pamplona
2026-04-18 10:28:59 -04:00
committed by GitHub
@@ -64,9 +64,11 @@ fun PaymentButton(
remember(note) {
(note?.event as? PaymentTargetsEvent)?.paymentTargets() ?: emptyList()
}
if (targets.isNotEmpty()) {
PaymentButtonWithTargets(targets)
}
}
}
@Composable
fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
@@ -94,14 +96,6 @@ fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
onDismiss = { expanded = false },
) {
M3ActionSection {
if (targets.isEmpty()) {
M3ActionRow(
icon = Icons.Outlined.AccountBalanceWallet,
text = stringRes(R.string.no_payment_targets_message),
enabled = false,
onClick = {},
)
} else {
targets.forEach { target ->
M3ActionRow(
icon = Icons.Outlined.AccountBalanceWallet,
@@ -122,7 +116,6 @@ fun PaymentButtonWithTargets(targets: List<PaymentTarget>) {
}
}
}
}
errorMessage?.let { msg ->
ErrorMessageDialog(