From 7d598265e60eecf06a27501a85e8db330aeed381 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 15 Dec 2023 15:24:43 -0800 Subject: sveltekit 2 --- src/routes/(app)/ln/[lnurl]/+page.server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/routes/(app)/ln') diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.js b/src/routes/(app)/ln/[lnurl]/+page.server.js index 332bc9e3..910ce5a5 100644 --- a/src/routes/(app)/ln/[lnurl]/+page.server.js +++ b/src/routes/(app)/ln/[lnurl]/+page.server.js @@ -3,7 +3,7 @@ import { error, fail, redirect } from "@sveltejs/kit"; export async function load({ params, parent }) { let { user } = await parent(); - if (!user) throw redirect(307, "/register"); + if (!user) redirect(307, "/register"); let data; @@ -11,11 +11,11 @@ export async function load({ params, parent }) { let { lnurl } = params; data = await get(`/decode?text=${lnurl}`); } catch (e) { - throw error(500, e.message); + error(500, e.message); } if (!["payRequest", "withdrawRequest"].includes(data.tag)) - throw error(500, "We only support LNURLp and LNURLw at this time"); + error(500, "We only support LNURLp and LNURLw at this time"); return data; } @@ -37,7 +37,7 @@ export const actions = { let { pr } = await fetch(`${callback}?amount=${amount * 1000}`).then((r) => r.json() ); - throw redirect(307, `/send/lightning/${pr}`); + redirect(307, `/send/lightning/${pr}`); }, withdraw: async ({ cookies, fetch, request }) => { @@ -70,6 +70,6 @@ export const actions = { let c = callback.includes("?") ? "&" : "?"; await fetch(`${callback}${c}k1=${k1}&pr=${pr}`).then((r) => r.json()); - throw redirect(307, `/ln/withdrawal/sent`); + redirect(307, `/ln/withdrawal/sent`); }, }; -- cgit v1.2.3