aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts
index 2df64e93..7348f96c 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.server.ts
+++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts
@@ -36,11 +36,13 @@ export async function load({ params, parent }) {
const { pr } = await fetch(url).then((r) => (r as Response).json());
+ let invoice;
try {
- const invoice = await get(`/invoice/${pr}`);
- if (invoice) redirect(307, `/invoice/${invoice.id}`);
+ invoice = await get(`/invoice/${pr}`);
} catch (e) {}
+ if (invoice) redirect(307, `/invoice/${invoice.id}`);
+
let path = `/send/lightning/${pr}`;
if (comment) path += `/${encodeURIComponent(comment)}`;
redirect(307, path);