From 3ffa2b25f50e0f8d444c28ba3e8c56cb7f5752d0 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Tue, 15 Aug 2023 15:51:43 -0500 Subject: [PATCH] approve all --- src/components/PendingNwc.tsx | 30 ++++++++++++++++++++++++------ src/i18n/en/translations.ts | 3 ++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/components/PendingNwc.tsx b/src/components/PendingNwc.tsx index c33ada8..ea0ab11 100644 --- a/src/components/PendingNwc.tsx +++ b/src/components/PendingNwc.tsx @@ -79,6 +79,14 @@ export function PendingNwc() { } } + async function approveAll() { + // clone the list so it doesn't update in place + const toApprove = [...pendingRequests()!]; + for (const item of toApprove) { + await payItem(item); + } + } + async function rejectItem(item: PendingItem) { try { setPaying(item.id); @@ -180,12 +188,22 @@ export function PendingNwc() { )} - - {i18n.t("settings.connections.pending_nwc.configure_link")} - +
+ + + {i18n.t( + "settings.connections.pending_nwc.configure_link" + )} + +
); diff --git a/src/i18n/en/translations.ts b/src/i18n/en/translations.ts index 5ec085b..38e21ac 100644 --- a/src/i18n/en/translations.ts +++ b/src/i18n/en/translations.ts @@ -268,7 +268,8 @@ export default { "Authorize external services to request payments from your wallet. Pairs great with Nostr clients.", pending_nwc: { title: "Pending Requests", - configure_link: "Configure" + configure_link: "Configure", + approve_all: "Approve All" } }, emergency_kit: {