From 2d794fbca3f1f4a2e2ae24023768a0f19feafe0d Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 29 Oct 2025 08:40:06 +0300 Subject: [PATCH] fix: defer loading stripe, again actually made it work this time --- src/lib/sections/about/Donate.svelte | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/sections/about/Donate.svelte b/src/lib/sections/about/Donate.svelte index 6ba8e25..14b5f84 100644 --- a/src/lib/sections/about/Donate.svelte +++ b/src/lib/sections/about/Donate.svelte @@ -22,11 +22,8 @@ import FancyInput from "$lib/components/functional/FancyInput.svelte"; import Panel from "$lib/components/visual/Panel.svelte"; import { effects, link, sanitize } from "$lib/store/index.svelte"; - import { - loadStripe, - type Stripe, - type StripeElements, - } from "@stripe/stripe-js"; + import { loadStripe } from "@stripe/stripe-js/pure"; + import { type Stripe, type StripeElements } from "@stripe/stripe-js"; import clsx from "clsx"; import { CalendarHeartIcon, @@ -60,6 +57,9 @@ const paymentClick = async () => { if (paymentState !== "prepay") return; + + if (!stripe) stripe = await loadStripe(PUB_STRIPE_KEY); + paymentState = "fetching"; const res = await fetch(`${PUB_DONATION_URL}/billing`, { method: "POST", @@ -90,8 +90,6 @@ const transition = "cubic-bezier(0.23, 1, 0.320, 1)"; onMount(async () => { - stripe = await loadStripe(PUB_STRIPE_KEY); - if (!isOfficial) { log( ["about", "donate"],