diff --git a/web/src/components/donate/DonateOptionsCard.svelte b/web/src/components/donate/DonateOptionsCard.svelte index 1ce362f9..8380a73e 100644 --- a/web/src/components/donate/DonateOptionsCard.svelte +++ b/web/src/components/donate/DonateOptionsCard.svelte @@ -11,6 +11,7 @@ import { donate } from "$lib/env"; + let customInput: HTMLInputElement; let customInputValue: number | null; type Processor = "stripe" | "liberapay"; @@ -34,6 +35,15 @@ const send = (amount: number) => { return donationMethods[processor](amount); } + + const sendCustom = () => { + if (!customInput.reportValidity()) { + return; + } + + const amount = Number(customInputValue) * 100; + send(amount); + }