diff options
| author | Adam Soltys <[email protected]> | 2024-10-14 15:53:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-14 15:53:40 -0700 |
| commit | eeca081f8c1b459653d9c8e3743a20b01056a7ee (patch) | |
| tree | 3ee3cb80c948c842d4a8a977638207800bf9c43e /src | |
| parent | 9bf9c7151be64317ec5b8b43fb41064e62dc743a (diff) | |
| download | coinos-ui-eeca081f8c1b459653d9c8e3743a20b01056a7ee.tar.gz coinos-ui-eeca081f8c1b459653d9c8e3743a20b01056a7ee.zip | |
hide maxfee unless error
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Lnurlp.svelte | 2 | ||||
| -rw-r--r-- | src/routes/(app)/ln/[lnurl]/+page.server.ts | 8 | ||||
| -rw-r--r-- | src/routes/(app)/send/lightning/[payreq]/+page.svelte | 36 |
3 files changed, 26 insertions, 20 deletions
diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index ef6c4e51..5f075607 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -48,7 +48,7 @@ {#if commentAllowed} <textarea - name="text" + name="comment" placeholder={$t("payments.message")} class="w-full p-4 border rounded-xl h-32 text-xl" bind:value={comment} diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts index 0caadfc0..cae220bf 100644 --- a/src/routes/(app)/ln/[lnurl]/+page.server.ts +++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts @@ -24,7 +24,9 @@ export const actions = { pay: async ({ fetch, request }) => { let error; - let { callback, amount, minSendable, maxSendable, comment } = await fd(request); + let { callback, amount, minSendable, maxSendable, comment } = await fd( + request + ); minSendable = Math.round(minSendable / 1000); maxSendable = Math.round(maxSendable / 1000); @@ -35,9 +37,9 @@ export const actions = { if (error) return fail(400, { error }); let url = `${callback}?amount=${amount * 1000}`; - if (comment) url += `&comment=${comment}`; - let { pr } = await fetch(url).then((r) => r.json()); + + let { pr } = await fetch(url).then((r) => r.json()); redirect(307, `/send/lightning/${pr}`); }, diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte index 046498c6..01f41d34 100644 --- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte @@ -108,25 +108,29 @@ <input name="amount" value={amount} type="hidden" /> <input name="pin" value={$pin} type="hidden" /> - <div class="w-40 mx-auto"> - <label for="maxfee" class="text-lg text-secondary" - >{$t("payments.maxfee")}</label - > - - <div class="flex"> - <input - id="maxfee" - name="maxfee" - bind:value={maxfee} - class="border-r-0 rounded-r-none py-2" - /> - <div - class="text-gray-600 rounded-r-2xl p-4 my-auto rounded-l-none rounded border bg-gray-100" + {#if form?.message} + <div class="w-40 mx-auto"> + <label for="maxfee" class="text-lg text-secondary" + >{$t("payments.maxfee")}</label > - ⚡️ + + <div class="flex"> + <input + id="maxfee" + name="maxfee" + bind:value={maxfee} + class="border-r-0 rounded-r-none py-2" + /> + <div + class="text-gray-600 rounded-r-2xl p-4 my-auto rounded-l-none rounded border bg-gray-100" + > + ⚡️ + </div> </div> </div> - </div> + {:else} + <input name="maxfee" type="hidden" bind:value={maxfee} /> + {/if} <div class="flex w-full"> <button |
