diff options
| author | Adam Soltys <[email protected]> | 2025-08-18 22:49:19 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-08-18 22:49:19 -0700 |
| commit | 89e536d64f3c10e93f9a73a9da9ee00b23ce53f0 (patch) | |
| tree | d046b18ac7a49935aa54254ddd9f272b65cc4603 | |
| parent | b5289c999efa8a7016695a0cb3effb53017f54eb (diff) | |
| download | coinos-ui-89e536d64f3c10e93f9a73a9da9ee00b23ce53f0.tar.gz coinos-ui-89e536d64f3c10e93f9a73a9da9ee00b23ce53f0.zip | |
fix redirect
| -rw-r--r-- | src/routes/(app)/ln/[lnurl]/+page.server.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts index 2df64e93..7348f96c 100644 --- a/src/routes/(app)/ln/[lnurl]/+page.server.ts +++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts @@ -36,11 +36,13 @@ export async function load({ params, parent }) { const { pr } = await fetch(url).then((r) => (r as Response).json()); + let invoice; try { - const invoice = await get(`/invoice/${pr}`); - if (invoice) redirect(307, `/invoice/${invoice.id}`); + invoice = await get(`/invoice/${pr}`); } catch (e) {} + if (invoice) redirect(307, `/invoice/${invoice.id}`); + let path = `/send/lightning/${pr}`; if (comment) path += `/${encodeURIComponent(comment)}`; redirect(307, path); |
