diff options
| author | Adam Soltys <[email protected]> | 2022-10-17 23:29:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-17 23:29:32 -0700 |
| commit | 02af363d2f0d552a72dc1c90bf8d785e04465d3a (patch) | |
| tree | 03fe0719e4c623cf6d6b649c0867b910b6db5199 /src/routes/launch/purchase/+page.svelte | |
| parent | 5e3d4133760962db28c4f3a595f0566bd59391ff (diff) | |
| download | coinos-ui-02af363d2f0d552a72dc1c90bf8d785e04465d3a.tar.gz coinos-ui-02af363d2f0d552a72dc1c90bf8d785e04465d3a.zip | |
invoice redirect
Diffstat (limited to 'src/routes/launch/purchase/+page.svelte')
| -rw-r--r-- | src/routes/launch/purchase/+page.svelte | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/routes/launch/purchase/+page.svelte b/src/routes/launch/purchase/+page.svelte index a7a2b51c..d31d20f0 100644 --- a/src/routes/launch/purchase/+page.svelte +++ b/src/routes/launch/purchase/+page.svelte @@ -1,21 +1,21 @@ <script> import { enhance } from '$app/forms'; - import { selectedRate } from '$lib/store'; + import { invoiceRedirect, selectedRate } from '$lib/store'; import { post } from '$lib/utils'; import { goto } from '$app/navigation'; export let data; - export let form; let amount = 25000; let { address, - currency, + currency, account: { balance }, username } = data.user; - let { ticket } = data; + let { tickets } = data; + let ticket = tickets.length; let invoice; let get = async (network) => { @@ -26,6 +26,7 @@ username }); + $invoiceRedirect = '/launch/purchase'; goto(`/invoice/${uuid}`); }; @@ -38,12 +39,13 @@ <div class="mx-auto h-screen flex items-center justify-center px-4"> <div class="font-normal text-gray-800 mx-auto mb-8 space-y-8"> <h1 class="mb-4 text-4xl font-bold leading-none tracking-tight text-gray-800 text-center"> - Confirm Purchase + Confirm Purchase </h1> <img src={`/tickets/${(ticket + 1).toString().padStart(2, '0')}.png`} class="w-full max-w-[800px]" + alt="Ticket" /> {#if balance > amount} @@ -63,8 +65,8 @@ </h1> <form action="?/lightning" method="POST"> - <input type="hidden" name="currency" value={currency} /> - <input type="hidden" name="username" value={username} /> + <input type="hidden" name="currency" value={currency} /> + <input type="hidden" name="username" value={username} /> <button class="bg-black text-white border rounded-full px-8 py-4 font-bold hover:opacity-80 mx-auto text-2xl" > |
