aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-17 11:22:55 -0800
committerAdam Soltys <[email protected]>2025-01-17 11:23:21 -0800
commit65e7795b091af8bc5a1e94cc46eb678e37789cec (patch)
tree54efe90c30af9f6b21c1c8cdb629093317d5f1db /src
parente8f6d70cf8dfa377f5da43fc8172ef02cfa8c416 (diff)
downloadcoinos-ui-65e7795b091af8bc5a1e94cc46eb678e37789cec.tar.gz
coinos-ui-65e7795b091af8bc5a1e94cc46eb678e37789cec.zip
zap right away
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/send/zap/[pubkey]/[...id]/+page.svelte66
1 files changed, 16 insertions, 50 deletions
diff --git a/src/routes/(app)/send/zap/[pubkey]/[...id]/+page.svelte b/src/routes/(app)/send/zap/[pubkey]/[...id]/+page.svelte
index 4a4928ea..6637cb47 100644
--- a/src/routes/(app)/send/zap/[pubkey]/[...id]/+page.svelte
+++ b/src/routes/(app)/send/zap/[pubkey]/[...id]/+page.svelte
@@ -24,8 +24,9 @@
if (form) {
loading = false;
event = await sign(request);
- let { pr } = await post("/post/zap", { event });
- goto(`/send/lightning/${pr}`);
+ let { pr: payreq } = await post("/post/zap", { event });
+ await post("/post/payments", { amount, payreq, pin: $pin });
+ goto(`/e/${id}`);
}
});
@@ -46,54 +47,19 @@
{$t(form.message)}
</div>
{/if}
- {#if amount}
- <div>
- <h1 class="text-lg text-secondary">
- {$t("payments.send")}
- </h1>
+ <form method="POST" action="?/setAmount" class="space-y-2" use:enhance>
+ <input type="hidden" value={a} name="amount" />
+ <input name="rate" value={$rate} type="hidden" />
- <Amount {amount} rate={$rate} {currency} {locale} />
- </div>
-
- <form
- method="POST"
- use:enhance
- onsubmit={submit}
- action="?/send"
- class="space-y-2"
+ <Numpad
+ bind:amount={a}
+ {currency}
+ {locale}
+ bind:rate={$rate}
+ submit={next}
+ />
+ <button type="submit" class="btn" bind:this={next}
+ >{$t("payments.next")}</button
>
- <input name="event" value={event} type="hidden" />
- <input name="amount" value={amount} type="hidden" />
- <input name="pin" value={$pin} type="hidden" />
-
- <button
- type="submit"
- class="btn btn-primary"
- disabled={loading}
- use:focus
- >
- {#if loading}
- <Spinner />
- {:else}
- {$t("payments.send")}
- {/if}
- </button>
- </form>
- {:else}
- <form method="POST" action="?/setAmount" class="space-y-2" use:enhance>
- <input type="hidden" value={a} name="amount" />
- <input name="rate" value={$rate} type="hidden" />
-
- <Numpad
- bind:amount={a}
- {currency}
- {locale}
- bind:rate={$rate}
- submit={next}
- />
- <button type="submit" class="btn" bind:this={next}
- >{$t("payments.next")}</button
- >
- </form>
- {/if}
+ </form>
</div>
07.753C112.878 108.789 113.561 111.282 113.424 113.239L108.833 130.387L102.379 154.475C101.896 155.596 100.681 157.27 97.9828 156.55C98.0777 156.687 91.0519 154.692 91.0519 154.692L86.2303 165.127L98.6278 168.449C100.937 169.07 103.198 169.713 105.42 170.327L101.349 185.552L110.866 188.104L114.9 173.04C117.504 173.793 120.026 174.493 122.495 175.151L118.475 190.143L128.003 192.696L132.081 177.5C148.334 180.907 160.586 180.031 165.856 165.938C170.101 154.592 165.795 147.866 157.264 143.33ZM130.882 114.322C136.256 115.762 153.598 118.645 150.707 129.443C147.931 139.793 131.36 134.057 125.98 132.616L130.882 114.322ZM118.097 162.02L123.506 141.851C129.963 143.579 150.692 147.22 147.515 159.088C144.468 170.47 124.559 163.746 118.097 162.02Z" fill="#0B9072"/> </g> <defs> <clipPath id="clip0_116_862"> <rect width="83.9761" height="106.37" fill="white" transform="translate(105.696 78.4165) rotate(15)"/> </clipPath> </defs> </svg>