diff options
Diffstat (limited to 'src/lib/parse.ts')
| -rw-r--r-- | src/lib/parse.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/lib/parse.ts b/src/lib/parse.ts index 6995f207..0ab3e809 100644 --- a/src/lib/parse.ts +++ b/src/lib/parse.ts @@ -10,7 +10,7 @@ export default async (t, host) => { if (t.startsWith("http")) redirect(307, t); if (t.startsWith(host)) redirect(307, `http://${t}`); - let amount, id, user; + let amount, user; t = t.trim(); t.toLowerCase().startsWith("bitcoin:") && @@ -37,7 +37,7 @@ export default async (t, host) => { if (t.toLowerCase().startsWith("ln")) { try { - ({ id } = await get(`/invoice/${t}`)); + await get(`/invoice/${t}`); } catch (e) { redirect(307, `/send/lightning/${t}`); } @@ -45,16 +45,9 @@ export default async (t, host) => { // bitcoin if (validate(t) || isLiquid(t)) { - try { - ({ id, user } = await get(`/invoice/${t}`)); - } catch (e) { - let r = `/send/bitcoin/${t}`; - if (amount) r += "/" + amount; - redirect(307, r); - } - - if (user) redirect(307, `/pay/${user.username}`); - else if (id) redirect(307, `/send/${id}`); + let r = `/send/bitcoin/${t}`; + if (amount) r += "/" + amount; + redirect(307, r); } if (t.startsWith("cashu")) { |
