diff options
| author | Adam Soltys <[email protected]> | 2024-10-31 09:04:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-31 09:25:47 -0700 |
| commit | 4742e72ec25823ceeea7848fb2e1f868bed7f472 (patch) | |
| tree | 031c15d9b1aeca23bd117490c69785e3cf69e450 /src/lib/parse.ts | |
| parent | a92dd4d39a86af41dd9cd6c9f58263a13f852906 (diff) | |
| download | coinos-ui-4742e72ec25823ceeea7848fb2e1f868bed7f472.tar.gz coinos-ui-4742e72ec25823ceeea7848fb2e1f868bed7f472.zip | |
detect internal payments
Diffstat (limited to 'src/lib/parse.ts')
| -rw-r--r-- | src/lib/parse.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/parse.ts b/src/lib/parse.ts index fcce7e1e..0ebbe003 100644 --- a/src/lib/parse.ts +++ b/src/lib/parse.ts @@ -29,6 +29,14 @@ export default async (t, host) => { if (t.includes("/fund")) redirect(307, t.substring(t.indexOf("/fund"))); + // invoice + let invoice; + try { + invoice = await get(`/invoice/${t}`); + } catch (e) {} + + if (invoice) redirect(307, `/send/invoice/${invoice.id}`); + // lightning if (t.toLowerCase().startsWith("lightning:")) t = t.toLowerCase().replace("lightning:", ""); @@ -69,12 +77,4 @@ export default async (t, host) => { } catch (e) {} if (fund) redirect(307, `/send/fund/${t}`); - - // invoice - let invoice; - try { - invoice = await get(`/invoice/${t}`); - } catch (e) {} - - if (invoice) redirect(307, `/send/invoice/${invoice.id}`); }; |
