diff options
| author | Adam Soltys <[email protected]> | 2023-03-11 16:36:40 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-11 16:36:40 -0800 |
| commit | ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05 (patch) | |
| tree | 49d1531fe55eec5e5a9faca5bad608944e4e2cb5 /src/routes/(app)/send | |
| parent | 9b5f8947c05ee59225ffa100e4ebd83d2a243b57 (diff) | |
| download | coinos-ui-ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05.tar.gz coinos-ui-ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05.zip | |
prompt for tip
Diffstat (limited to 'src/routes/(app)/send')
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.server.js | 2 | ||||
| -rw-r--r-- | src/routes/(app)/send/user/[username]/[...amount]/+page.svelte | 16 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 0d23d307..261345fa 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -6,7 +6,7 @@ export async function load({ params: { id }, parent, url }) { let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); - if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); + if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); return { amount, address, tip, rate, payreq: text, recipient }; } diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte index 1bb88277..af6a6368 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte @@ -30,11 +30,15 @@ ({ hash } = await post(`/${subject.username}/invoice`, { invoice: { amount, + hash: 'internal', rate: rates[subject.currency], + prompt: subject.prompt, type: 'internal' }, user: subject })); + + goto(`/${subject.username}/invoice/${hash}`); }; let loading; @@ -56,17 +60,7 @@ {/if} <div class="container px-4 mt-20 max-w-xl mx-auto space-y-8"> - {#if amount} - <h1 class="text-center text-3xl md:text-4xl font-bold mb-6">Sending</h1> - <div class="text-center mb-8"> - <h2 class="text-2xl md:text-3xl font-semibold"> - {f(amountFiat, currency)} - </h2> - <h3 class="text-secondary md:text-lg mb-6 mt-1">{sat(amount)}</h3> - </div> - {:else} - <Numpad bind:amount={a} bind:amountFiat={af} {currency} bind:fiat /> - {/if} + <Numpad bind:amount={a} bind:amountFiat={af} {currency} bind:fiat /> <form method="POST" use:enhance on:submit={submit}> <input name="amount" value={amount} type="hidden" /> |
