From bf925a332a7fde8b19f5eea677dcb0346805facd Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 3 Nov 2022 15:57:03 -0700 Subject: display tips --- src/routes/(app)/send/[uuid=uuid]/+page.server.js | 3 ++- src/routes/(app)/send/[uuid=uuid]/+page.svelte | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/routes/(app)/send') diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.server.js b/src/routes/(app)/send/[uuid=uuid]/+page.server.js index c9c77f70..cdf06e5c 100644 --- a/src/routes/(app)/send/[uuid=uuid]/+page.server.js +++ b/src/routes/(app)/send/[uuid=uuid]/+page.server.js @@ -3,8 +3,9 @@ import { btc as asset, auth, get, post } from '$lib/utils'; export async function load({ params, parent }) { let { user } = await parent(); - let { amount, address, text, user: recipient } = await get(`/invoice/${params.uuid}`); + let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.uuid}`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); + if (tip) amount += tip; return { amount, address, payreq: text, recipient }; } diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.svelte b/src/routes/(app)/send/[uuid=uuid]/+page.svelte index b5a1593a..a07ae937 100644 --- a/src/routes/(app)/send/[uuid=uuid]/+page.svelte +++ b/src/routes/(app)/send/[uuid=uuid]/+page.svelte @@ -54,10 +54,7 @@

Send

- {fiat ? f(amountFiat, currency) : s(amount)} - {#if !fiat} - sats - {/if} + {fiat ? f(amountFiat, currency) : '⚡️' + s(amount)}

to

-- cgit v1.2.3