diff options
| author | Adam Soltys <[email protected]> | 2024-12-19 14:12:56 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-12-19 14:13:32 -0800 |
| commit | 5c46fe3126d40f2798ed5bb106c8a0e560b27d86 (patch) | |
| tree | 4aea391a7e9c1327c513f8911f8b20dc3a9b46f4 /src/lib/parse.ts | |
| parent | dac37fd34b2faea3586094c0cf1d8b55b1574d7a (diff) | |
| download | coinos-ui-5c46fe3126d40f2798ed5bb106c8a0e560b27d86.tar.gz coinos-ui-5c46fe3126d40f2798ed5bb106c8a0e560b27d86.zip | |
bolt 12
Diffstat (limited to 'src/lib/parse.ts')
| -rw-r--r-- | src/lib/parse.ts | 10 |
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}`); } } |
