aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/ln
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-07 23:40:52 -0800
committerAdam Soltys <[email protected]>2024-12-07 23:40:52 -0800
commitfd06610f287c5975b08317b131c43c478cdf6368 (patch)
treec2d470efa38a2a65d5c5ee099a30fe1db3a29b6f /src/routes/(app)/ln
parent6ad016b4b5f3e1baf1d40b898b0e5c964df54590 (diff)
downloadcoinos-ui-fd06610f287c5975b08317b131c43c478cdf6368.tar.gz
coinos-ui-fd06610f287c5975b08317b131c43c478cdf6368.zip
fix lnurl rate
Diffstat (limited to 'src/routes/(app)/ln')
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts
index 6f121db1..681137ad 100644
--- a/src/routes/(app)/ln/[lnurl]/+page.server.ts
+++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts
@@ -5,21 +5,21 @@ import { error, fail, redirect } from "@sveltejs/kit";
export async function load({ params, parent }) {
const { user } = await parent();
if (!user) redirect(307, "/register");
+ const rates = await getRates();
- let data = {
- rate: await getRates()[user.currency],
- };
-
+ let data;
try {
const { lnurl } = params;
data = await get(`/decode?text=${lnurl}`);
- } catch (e: any) {
- error(500, e.message);
+ } catch (e) {
+ const { message } = e as Error;
+ error(500, message);
}
if (!["payRequest", "withdrawRequest"].includes(data.tag))
error(500, "We only support LNURLp and LNURLw at this time");
+ data.rate = rates[user.currency];
return data;
}