From 2114156be3f89a2ef4c5bd13fd6d7a51d8fbc135 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 12 Sep 2024 15:23:45 -0700 Subject: self custodial send --- src/routes/(app)/invoice/+page.server.ts | 4 ++-- src/routes/(app)/invoice/[id]/+layout.server.ts | 7 +++---- src/routes/(app)/invoice/[id]/+page.svelte | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/+page.server.ts b/src/routes/(app)/invoice/+page.server.ts index 83127457..05851430 100644 --- a/src/routes/(app)/invoice/+page.server.ts +++ b/src/routes/(app)/invoice/+page.server.ts @@ -2,8 +2,8 @@ import { auth, post } from "$lib/utils"; import { error, redirect } from "@sveltejs/kit"; import type { Invoice } from "$lib/types"; -export let load = async ({ cookies, params, parent }) => { - let { account } = params; +export let load = async ({ cookies, parent }) => { + let account = cookies.get("account"); let { subject, user, rates } = await parent(); let invoice: Invoice = { diff --git a/src/routes/(app)/invoice/[id]/+layout.server.ts b/src/routes/(app)/invoice/[id]/+layout.server.ts index e7144b15..71f53e09 100644 --- a/src/routes/(app)/invoice/[id]/+layout.server.ts +++ b/src/routes/(app)/invoice/[id]/+layout.server.ts @@ -1,4 +1,4 @@ -import Qr from "qrcode-base64"; +import * as Qr from "qrcode-base64"; import { get } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; @@ -26,11 +26,10 @@ export async function load({ depends, params, url, parent }) { (!amount && (pending || received)) || (amount > 0 && (pending >= amount || received >= amount)); if (paid && !url.pathname.endsWith("paid")) { - redirect( 307, `/invoice/${id}/paid` + (options ? "?options=true" : "") - ); + redirect(307, `/invoice/${id}/paid` + (options ? "?options=true" : "")); } - let src = Qr.drawImg(invoice.text || "", { size: 340 }); + let src = Qr.drawImg(invoice.text || "", { size: 500 }); return { id, invoice, subject, src }; } diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index c4810889..36f5d261 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -136,14 +136,14 @@ > {txt} {:else} -
+
{txt}
{/if} -- cgit v1.2.3