aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-19 14:12:56 -0800
committerAdam Soltys <[email protected]>2024-12-19 14:13:32 -0800
commit5c46fe3126d40f2798ed5bb106c8a0e560b27d86 (patch)
tree4aea391a7e9c1327c513f8911f8b20dc3a9b46f4 /src/lib
parentdac37fd34b2faea3586094c0cf1d8b55b1574d7a (diff)
downloadcoinos-ui-5c46fe3126d40f2798ed5bb106c8a0e560b27d86.tar.gz
coinos-ui-5c46fe3126d40f2798ed5bb106c8a0e560b27d86.zip
bolt 12
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/parse.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/parse.ts b/src/lib/parse.ts
index 7ddb2104..309e53d7 100644
--- a/src/lib/parse.ts
+++ b/src/lib/parse.ts
@@ -44,12 +44,6 @@ export default async (s, host) => {
if (t.toLowerCase().startsWith("lnurl")) redirect(307, `/ln/${t}`);
if (t.includes(":")) t = t.split(":")[1];
- if (t.toLowerCase().startsWith("lno")) {
- const { offer_amount_msat: a } = await get(`/decode/${t}`);
- if (a) ({ invoice: t } = await post("/fetchinvoice", { offer: t }));
- redirect(307, `/send/lightning/${t}`);
- }
-
if (t.includes("lightning=")) {
const url = new URL(t);
const params = new URLSearchParams(url.search);
@@ -60,6 +54,10 @@ export default async (s, host) => {
try {
await get(`/invoice/${t}`);
} catch (e) {
+ if (t.toLowerCase().startsWith("lno")) {
+ const { offer_amount_msat: a } = await get(`/decode/${t}`);
+ if (a) ({ invoice: t } = await post("/fetchinvoice", { offer: t }));
+ }
redirect(307, `/send/lightning/${t}`);
}
}