Replace remote with local repo
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user