aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/send/[...text]/+page.server.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/routes/send/[...text]/+page.server.js b/src/routes/send/[...text]/+page.server.js
index ec764882..471724e4 100644
--- a/src/routes/send/[...text]/+page.server.js
+++ b/src/routes/send/[...text]/+page.server.js
@@ -8,7 +8,14 @@ let parse = async (t) => {
// lightning
if (t.startsWith('ln')) {
- throw redirect(303, `/send/lightning/${t}`);
+ let user;
+ try {
+ ({ user } = await get(`/invoice/${t}`));
+ } catch (e) {
+ throw redirect(303, `/send/lightning/${t}`);
+ }
+
+ if (user) throw redirect(303, `/send/user/${user.username}`);
}
// bitcoin
@@ -41,8 +48,8 @@ let parse = async (t) => {
};
export async function load({ params }) {
- let { text } = params;
- await parse(text);
+ let { text } = params;
+ await parse(text);
}
export const actions = {