aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)')
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts
index c078ae8e..0caadfc0 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.server.ts
+++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts
@@ -24,7 +24,7 @@ export const actions = {
pay: async ({ fetch, request }) => {
let error;
- let { callback, amount, minSendable, maxSendable } = await fd(request);
+ let { callback, amount, minSendable, maxSendable, comment } = await fd(request);
minSendable = Math.round(minSendable / 1000);
maxSendable = Math.round(maxSendable / 1000);
@@ -34,9 +34,10 @@ export const actions = {
error = `Amount must be at most ${maxSendable} sats`;
if (error) return fail(400, { error });
- let { pr } = await fetch(`${callback}?amount=${amount * 1000}`).then((r) =>
- r.json()
- );
+ let url = `${callback}?amount=${amount * 1000}`;
+
+ if (comment) url += `&comment=${comment}`;
+ let { pr } = await fetch(url).then((r) => r.json());
redirect(307, `/send/lightning/${pr}`);
},