aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send/invoice
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-29 15:19:38 -0800
committerAdam Soltys <[email protected]>2024-01-29 15:19:38 -0800
commitb54d3afc6465acd5e518a8b4970be1ab75b361b1 (patch)
treec2ab7a8d91140ec6a60bd2b76e25c68a0355ee38 /src/routes/(app)/send/invoice
parenta7dd56863aada46964a4277f0a5940de68c332b5 (diff)
downloadcoinos-ui-b54d3afc6465acd5e518a8b4970be1ab75b361b1.tar.gz
coinos-ui-b54d3afc6465acd5e518a8b4970be1ab75b361b1.zip
autowithdrawals
Diffstat (limited to 'src/routes/(app)/send/invoice')
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.server.js1
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte11
2 files changed, 7 insertions, 5 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js
index 88017362..c6b0a9a4 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.server.js
+++ b/src/routes/(app)/send/invoice/[id]/+page.server.js
@@ -41,6 +41,7 @@ export const actions = {
await post("/payments", body, auth(cookies));
} catch (e) {
+ console.log("payment failed", params, e);
return fail(400, { message: e.message });
}
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index e857f717..dd637d70 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -35,8 +35,8 @@
amountFiat = af;
};
- let loading;
- let submit = () => (loading = true);
+ let submitting;
+ let submit = () => (submitting = true);
let external = async () => {
let invoice = { type: "lightning", amount, currency };
@@ -52,8 +52,8 @@
$: update(form);
let update = () => {
- if (form?.message.includes("pin")) $pin = undefined;
- loading = false;
+ if (form?.message?.includes("pin")) $pin = undefined;
+ submitting = false;
};
// onMount(async () => {
@@ -152,8 +152,9 @@
use:focus
type="submit"
class="opacity-100 hover:opacity-80'} rounded-2xl border py-3 font-bold mx-auto mt-2 bg-black text-white px-4 w-24"
+ disabled={submitting}
>
- {#if loading}
+ {#if submitting}
<Spinner />
{:else}
{$t("payments.send")}