From 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 20:10:43 -0800 Subject: format --- src/routes/(app)/invoice/[id]/+layout.server.ts | 3 +-- src/routes/(app)/invoice/[id]/+page.svelte | 23 +++----------------- src/routes/(app)/invoice/[id]/paid/+page.svelte | 11 ++-------- src/routes/(app)/invoice/[id]/tip/+page.server.ts | 6 +----- src/routes/(app)/invoice/[id]/tip/+page.svelte | 26 ++++++----------------- 5 files changed, 13 insertions(+), 56 deletions(-) (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/[id]/+layout.server.ts b/src/routes/(app)/invoice/[id]/+layout.server.ts index d6ee4246..a0d7d676 100644 --- a/src/routes/(app)/invoice/[id]/+layout.server.ts +++ b/src/routes/(app)/invoice/[id]/+layout.server.ts @@ -31,8 +31,7 @@ export async function load({ cookies, depends, params, url, parent }) { !(url.pathname.includes("tip") || url.pathname.includes("memo")) && !options ) { - if (invoice.prompt && invoice.tip === null) - redirect(307, `/invoice/${id}/tip`); + if (invoice.prompt && invoice.tip === null) redirect(307, `/invoice/${id}/tip`); else { redirect(307, `/send/invoice/${id}`); } diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index bf62a062..2810b39c 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -2,20 +2,7 @@ import { getWallet } from "$lib/ark"; import { enhance } from "$app/forms"; import { send } from "$lib/socket"; - import { - btc, - loc, - post, - copy, - f, - fail, - success, - get, - types, - sat, - s, - sats, - } from "$lib/utils"; + import { btc, loc, post, copy, f, fail, success, get, types, sat, s, sats } from "$lib/utils"; import { tick, onMount, onDestroy } from "svelte"; import { browser } from "$app/environment"; import { last, showQr, amountPrompt } from "$lib/store"; @@ -149,13 +136,9 @@ let fiat = $state(true); let amountFiat = $derived(parseFloat(((amount * rate) / sats).toFixed(2))); let tipAmount = $derived(((tip * rate) / sats).toFixed(2)); - let link = $derived( - [types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`, - ); + let link = $derived([types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`); - let txt = $derived( - [types.bitcoin, types.liquid].includes(type) ? hash : text, - ); + let txt = $derived([types.bitcoin, types.liquid].includes(type) ? hash : text);
diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte index 30679ac3..1a09653f 100644 --- a/src/routes/(app)/invoice/[id]/paid/+page.svelte +++ b/src/routes/(app)/invoice/[id]/paid/+page.svelte @@ -5,9 +5,7 @@ import { loc } from "$lib/utils"; let { data } = $props(); - let { amount, currency, rate, received, pending, tip, user, id } = $derived( - data.invoice, - ); + let { amount, currency, rate, received, pending, tip, user, id } = $derived(data.invoice); let locale = $derived(loc(user)); // toast.pop(0); @@ -15,12 +13,7 @@
{#if pending} - +

Payment detected

diff --git a/src/routes/(app)/invoice/[id]/tip/+page.server.ts b/src/routes/(app)/invoice/[id]/tip/+page.server.ts index 16cc22fa..91ccebca 100644 --- a/src/routes/(app)/invoice/[id]/tip/+page.server.ts +++ b/src/routes/(app)/invoice/[id]/tip/+page.server.ts @@ -44,11 +44,7 @@ export const actions = { tip: form.tip ?? null, }; - const { id } = await post( - `/invoice/${form.id}`, - { invoice }, - auth(cookies), - ); + const { id } = await post(`/invoice/${form.id}`, { invoice }, auth(cookies)); redirect(307, `/invoice/${id}`); }, diff --git a/src/routes/(app)/invoice/[id]/tip/+page.svelte b/src/routes/(app)/invoice/[id]/tip/+page.svelte index 1183093e..32ba78a2 100644 --- a/src/routes/(app)/invoice/[id]/tip/+page.svelte +++ b/src/routes/(app)/invoice/[id]/tip/+page.svelte @@ -107,18 +107,13 @@
{f(amountFiat, currency, locale)} - +{f(tipAmount, currency, locale)} + +{f(tipAmount, currency, locale)}
{:else}
-
{s(amount, locale)}
@@ -134,12 +129,8 @@
{#if tip} - - + + {:else} {#each tipAmounts as amount, i} {#if i === 0} @@ -163,10 +154,7 @@
- {$t("payments.cancel")} @@ -186,9 +174,7 @@ placeholder={$t("payments.amount")} use:focus /> - + {/if}
-- cgit v1.2.3