From 0217fd3eb39cab4965cc110353f51dc35aa41643 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 3 Sep 2024 17:29:41 -0400 Subject: [PATCH] Moves the profile zap to threads --- .../main/java/com/vitorpamplona/amethyst/model/Account.kt | 7 ++++++- .../amethyst/ui/screen/loggedIn/ProfileScreen.kt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 5a2fbd47c..b87a8204e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -1192,7 +1192,12 @@ class Account( LocalCache.consume(event, zappedNote) { it.response(signer) { onResponse(it) } } - Client.send(event, nip47.relayUri, wcListener.feedTypes) { wcListener.destroy() } + Client.send( + signedEvent = event, + relay = nip47.relayUri, + feedTypes = wcListener.feedTypes, + onDone = { wcListener.destroy() }, + ) onSent() } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt index bc0020a54..cb8136e0b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt @@ -1195,7 +1195,7 @@ fun DisplayLNAddress( zapExpanded = false // pay directly if (accountViewModel.account.hasWalletConnectSetup()) { - accountViewModel.account.sendZapPaymentRequestFor(it, null, onSent = {}) { response -> + accountViewModel.sendZapPaymentRequestFor(it, null, onSent = {}) { response -> if (response is PayInvoiceSuccessResponse) { showInfoMessageDialog = stringRes(context, R.string.payment_successful) } else if (response is PayInvoiceErrorResponse) {