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 | 174ad83576bee5ed654d8edba6e96b68c5e3ad33 (patch) | |
| tree | 4aea391a7e9c1327c513f8911f8b20dc3a9b46f4 /src/lib/parse.ts | |
| parent | 0a755a5bfa4a7ec1260568b7f76dd6b9f924e4ef (diff) | |
| download | coinos-ui-174ad83576bee5ed654d8edba6e96b68c5e3ad33.tar.gz coinos-ui-174ad83576bee5ed654d8edba6e96b68c5e3ad33.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}`); } } |
