diff options
Diffstat (limited to 'src/routes/(app)/send/bitcoin')
| -rw-r--r-- | src/routes/(app)/send/bitcoin/[address]/+layout.server.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts index a6edf8b0..68191311 100644 --- a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts +++ b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts @@ -2,22 +2,22 @@ import { auth, get } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; export async function load({ cookies, params, parent }) { - let { user } = await parent(); - let aid = cookies.get("aid"); - let { address } = params; - let { balance } = await get(`/account/${aid}`, auth(cookies)); + const { user } = await parent(); + const aid = cookies.get("aid"); + const { address } = params; + const { balance } = await get(`/account/${aid}`, auth(cookies)); - try { - let invoice = await get(`/invoice/${address}`); + try { + const invoice = await get(`/invoice/${address}`); - if (invoice) { - let recipient = await get(`/users/${invoice.uid}`); - if (recipient?.id !== user.id) - redirect(307, `/pay/${recipient.username}`); - } - } catch (e) { - // invoice not found - } + if (invoice) { + const recipient = await get(`/users/${invoice.uid}`); + if (recipient?.id !== user.id) + redirect(307, `/pay/${recipient.username}`); + } + } catch (e) { + // invoice not found + } - return { balance }; + return { balance }; } |
