aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-14 15:37:09 -0700
committerAdam Soltys <[email protected]>2024-10-14 15:37:09 -0700
commit9bf9c7151be64317ec5b8b43fb41064e62dc743a (patch)
tree18668a55a7016c0398e20a49a22889d805d879a4 /src/routes
parentdbb746bf404e7ed302c34b6631a170aff57c64c6 (diff)
downloadcoinos-ui-9bf9c7151be64317ec5b8b43fb41064e62dc743a.tar.gz
coinos-ui-9bf9c7151be64317ec5b8b43fb41064e62dc743a.zip
support lnurl comments
Diffstat (limited to 'src/routes')
-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}`);
},