approve all

This commit is contained in:
Paul Miller
2023-08-15 15:51:43 -05:00
committed by Tony Giorgio
parent 32dfd30136
commit 3ffa2b25f5
2 changed files with 26 additions and 7 deletions

View File

@@ -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() {
)}
</For>
</VStack>
<A
href="/settings/connections"
class="self-center font-semibold text-m-red no-underline active:text-m-red/80"
>
{i18n.t("settings.connections.pending_nwc.configure_link")}
</A>
<div class="flex w-full justify-around">
<button
class="font-semibold text-m-green active:text-m-red/80"
onClick={approveAll}
>
{i18n.t("settings.connections.pending_nwc.approve_all")}
</button>
<A
href="/settings/connections"
class="self-center font-semibold text-m-red no-underline active:text-m-red/80"
>
{i18n.t(
"settings.connections.pending_nwc.configure_link"
)}
</A>
</div>
</Card>
</Show>
);

View File

@@ -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: {