aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/parse.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-07-19 22:56:05 -0700
committerAdam Soltys <[email protected]>2025-07-19 22:56:05 -0700
commit476418f9711ac91760a9ca279a6e671d88e70fc3 (patch)
tree42bcd2dbf4fb8977baad89a6089924e097a0d921 /src/lib/parse.ts
parentd87ecae6ee46af4790e1f57cd5d82a35ab29e646 (diff)
downloadcoinos-ui-476418f9711ac91760a9ca279a6e671d88e70fc3.tar.gz
coinos-ui-476418f9711ac91760a9ca279a6e671d88e70fc3.zip
handle null tips
Diffstat (limited to 'src/lib/parse.ts')
-rw-r--r--src/lib/parse.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/parse.ts b/src/lib/parse.ts
index f6405e4a..b4bf837c 100644
--- a/src/lib/parse.ts
+++ b/src/lib/parse.ts
@@ -8,6 +8,7 @@ export default async (s, host) => {
if (!s) return;
let t = s.trim();
let amount;
+ let invoice;
let user;
if (t.startsWith("http")) redirect(307, t);
@@ -57,7 +58,6 @@ export default async (s, host) => {
t = params.get("lightning");
}
- let invoice;
if (t.toLowerCase().startsWith("ln")) {
try {
invoice = await get(`/invoice/${t}`);
@@ -71,6 +71,8 @@ export default async (s, host) => {
}
}
+ if (invoice) redirect(307, `/invoice/${invoice.id}`);
+
if (t.match(/^🥜([\uFE00-\uFE0F]|[\uE0100-\uE01EF]+)$/)) {
t = Array.from(t)
.slice(1)