Replace remote with local repo

This commit is contained in:
drjones
2026-04-26 22:28:40 -07:00
parent 04d64fb993
commit e7c9da944e
57 changed files with 3658 additions and 3971 deletions

View File

@@ -163,11 +163,27 @@ export default function AddFundsPage() {
};
if (data.settled && !invoice.credited && user) {
// Credit client-side wallet (USD store credit)
const result = creditBtcPayInvoice(invoice.invoiceId, invoice.usdAmount);
if (result.ok) {
updated.credited = true;
setBpSuccess(`$${invoice.usdAmount.toFixed(2)} USD credited to @${user.username}!`);
}
// Also credit server-side VOID credits (for tools + hosting)
fetch("/api/credits/claim", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ invoiceId: invoice.invoiceId, handle: user.username }),
})
.then((r) => r.json())
.then((d: { ok: boolean; voidCredited?: number }) => {
if (d.ok && d.voidCredited) {
setBpSuccess((prev) =>
(prev ?? "") + `${d.voidCredited} VOID credits added to tool vault.`,
);
}
})
.catch(() => void 0);
stopPoll();
}