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:
+2
-9
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user