aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send/invoice
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
committerAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
commit56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch)
treed6bc2557c56b93177bb14aa376847c6e123a4862 /src/routes/(app)/send/invoice
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'src/routes/(app)/send/invoice')
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.server.ts16
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte39
2 files changed, 9 insertions, 46 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.ts b/src/routes/(app)/send/invoice/[id]/+page.server.ts
index 2e268b99..59add224 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.server.ts
+++ b/src/routes/(app)/send/invoice/[id]/+page.server.ts
@@ -32,21 +32,13 @@ export async function load({ cookies, depends, params: { id }, parent }) {
if (p) redirect(307, `/sent/${p.id}`);
}
- if (invoice.amount && invoice.prompt && invoice.tip === null)
- redirect(307, `/invoice/${id}/tip`);
+ if (invoice.amount && invoice.prompt && invoice.tip === null) redirect(307, `/invoice/${id}/tip`);
- if (invoice.memoPrompt && invoice.memo === null)
- redirect(307, `/invoice/${id}/memo`);
+ if (invoice.memoPrompt && invoice.memo === null) redirect(307, `/invoice/${id}/memo`);
- if (user && invoice.aid === aid)
- error(500, { message: "Cannot send to self" });
+ if (user && invoice.aid === aid) error(500, { message: "Cannot send to self" });
else if (user && ![types.lightning, types.bolt12].includes(invoice.type))
- redirect(
- 307,
- `/send/${invoice.type === types.ecash ? "ecash" : "bitcoin"}/${
- invoice.hash
- }`,
- );
+ redirect(307, `/send/${invoice.type === types.ecash ? "ecash" : "bitcoin"}/${invoice.hash}`);
if (!user) redirect(307, `/invoice/${id}`);
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index f3f2f618..9174cf4c 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -11,18 +11,7 @@
import Numpad from "$comp/Numpad.svelte";
import Spinner from "$comp/Spinner.svelte";
import { page } from "$app/stores";
- import {
- btc,
- sat,
- post,
- back,
- f,
- toFiat,
- s,
- sats,
- focus,
- loc,
- } from "$lib/utils";
+ import { btc, sat, post, back, f, toFiat, s, sats, focus, loc } from "$lib/utils";
let { data, form }: any = $props();
let { trusted, balance, invoice, user } = $state(data);
@@ -156,14 +145,7 @@
{/each}
{/if}
{:else}
- <Numpad
- bind:amount={a}
- bind:amountFiat={af}
- bind:fiat
- {currency}
- {rate}
- {submit}
- />
+ <Numpad bind:amount={a} bind:amountFiat={af} bind:fiat {currency} {rate} {submit} />
{/if}
<form method="POST" use:enhance={handler(toggle)} class="space-y-2">
@@ -175,12 +157,7 @@
<div class="flex w-full text-xl">
{#if amount}
- <button
- use:focus
- type="submit"
- class="btn btn-primary"
- disabled={submitting}
- >
+ <button use:focus type="submit" class="btn btn-primary" disabled={submitting}>
{#if submitting}
<Spinner />
{:else}
@@ -188,11 +165,7 @@
{/if}
</button>
{:else}
- <button
- type="button"
- class="btn !w-auto grow"
- onclick={setMax}
- onkeydown={setMax}
+ <button type="button" class="btn !w-auto grow" onclick={setMax} onkeydown={setMax}
>{#if $fiatStore}
Max {f((balance * rate) / sats, currency, locale)}
{:else}
@@ -210,9 +183,7 @@
</button>
{/if}
</div>
- <button type="button" class="btn" onclick={external}
- >{$t("payments.moreOptions")}</button
- >
+ <button type="button" class="btn" onclick={external}>{$t("payments.moreOptions")}</button>
{#if !trusted}
<button type="button" class="btn" onclick={toggleTrust}>