aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/parse.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-31 09:04:09 -0700
committerAdam Soltys <[email protected]>2024-10-31 09:25:47 -0700
commiteb4e11fd5e90284585e5c3c7bc9e86febaa29114 (patch)
tree031c15d9b1aeca23bd117490c69785e3cf69e450 /src/lib/parse.ts
parent04723fcee3091473bb5f9dc297ea82bda13b8154 (diff)
downloadcoinos-ui-eb4e11fd5e90284585e5c3c7bc9e86febaa29114.tar.gz
coinos-ui-eb4e11fd5e90284585e5c3c7bc9e86febaa29114.zip
detect internal payments
Diffstat (limited to 'src/lib/parse.ts')
-rw-r--r--src/lib/parse.ts16
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}`);
};