From f47f4ee4afc4e1cc33018d937080c31ee583e40d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 10 Oct 2024 23:22:34 -0700 Subject: lightning address default --- src/routes/(app)/invoice/+page.server.ts | 1 + src/routes/(app)/invoice/[id]/+page.svelte | 56 +++++++++++++----------------- 2 files changed, 25 insertions(+), 32 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 b8a2fe06..fa644eb9 100644 --- a/src/routes/(app)/invoice/+page.server.ts +++ b/src/routes/(app)/invoice/+page.server.ts @@ -5,6 +5,7 @@ import type { Invoice } from "$lib/types"; export let load = async ({ cookies, parent }) => { let aid = cookies.get("aid"); let { subject, user, rates } = await parent(); + if (aid === user.id) redirect(307, `/${user.username}/receive`) let invoice: Invoice = { aid, diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index d8b7559f..b59b3f77 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -4,13 +4,11 @@ import { btc, post, - back, copy, f, get, types, sat, - reverseFormat, s, sats, } from "$lib/utils"; @@ -19,8 +17,6 @@ import { last, showQr, amountPrompt } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; import Icon from "$comp/Icon.svelte"; - import Heart from "$comp/Heart.svelte"; - import Image from "$comp/Image.svelte"; import Numpad from "$comp/Numpad.svelte"; import { t } from "$lib/translations"; import { goto, invalidate } from "$app/navigation"; @@ -142,10 +138,10 @@ /> - {:else} -
+ {/if} + + {#if type !== types.lightning || !$showQr} +
{txt}
{/if} @@ -221,21 +217,23 @@ {/if} -
- -
+ {#if type === types.lightning} +
+ +
+ {/if}
{#if aid === user?.id} @@ -299,7 +297,7 @@ class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50" >
-
Ok
+
{$t("payments.ok")}
@@ -336,9 +334,3 @@ {/if} - - -- cgit v1.2.3