aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-08-06 22:59:28 -0700
committerAdam Soltys <[email protected]>2025-08-06 22:59:28 -0700
commit597b2b14c3c9d58f8eb4fad18082d029c1b65b21 (patch)
tree6268dc2d88fbaccdf476fab53ed142f9a1b59e21
parentd2f51512499dded132326488d471540c718e60ee (diff)
downloadcoinos-ui-597b2b14c3c9d58f8eb4fad18082d029c1b65b21.tar.gz
coinos-ui-597b2b14c3c9d58f8eb4fad18082d029c1b65b21.zip
handle no invoice
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.ts11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts
index 17a22477..fe20bfd3 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.server.ts
+++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts
@@ -33,19 +33,16 @@ export async function load({ params, parent }) {
const { pr } = await fetch(url).then((r) => (r as Response).json());
- console.log("PR", pr);
- const invoice = await get(`/invoice/${pr}`);
- console.log("INV", invoice);
- if (invoice) redirect(307, `/invoice/${invoice.id}`);
+ try {
+ const invoice = await get(`/invoice/${pr}`);
+ if (invoice) redirect(307, `/invoice/${invoice.id}`);
+ } catch (e) {}
let path = `/send/lightning/${pr}`;
if (comment) path += `/${encodeURIComponent(comment)}`;
- console.log("PATH", path)
redirect(307, path);
} else if (callback.includes(PUBLIC_DOMAIN)) {
- console.log("CALLBACK", callback);
const username = url.split(`https://${PUBLIC_DOMAIN}/p/`)[1];
- console.log("UN", username);
redirect(307, `/pay/${username}`);
}