mirror of https://github.com/VERT-sh/VERT.git
fix: defer loading stripe, again
actually made it work this time
This commit is contained in:
parent
2760838927
commit
2d794fbca3
|
|
@ -22,11 +22,8 @@
|
||||||
import FancyInput from "$lib/components/functional/FancyInput.svelte";
|
import FancyInput from "$lib/components/functional/FancyInput.svelte";
|
||||||
import Panel from "$lib/components/visual/Panel.svelte";
|
import Panel from "$lib/components/visual/Panel.svelte";
|
||||||
import { effects, link, sanitize } from "$lib/store/index.svelte";
|
import { effects, link, sanitize } from "$lib/store/index.svelte";
|
||||||
import {
|
import { loadStripe } from "@stripe/stripe-js/pure";
|
||||||
loadStripe,
|
import { type Stripe, type StripeElements } from "@stripe/stripe-js";
|
||||||
type Stripe,
|
|
||||||
type StripeElements,
|
|
||||||
} from "@stripe/stripe-js";
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import {
|
import {
|
||||||
CalendarHeartIcon,
|
CalendarHeartIcon,
|
||||||
|
|
@ -60,6 +57,9 @@
|
||||||
|
|
||||||
const paymentClick = async () => {
|
const paymentClick = async () => {
|
||||||
if (paymentState !== "prepay") return;
|
if (paymentState !== "prepay") return;
|
||||||
|
|
||||||
|
if (!stripe) stripe = await loadStripe(PUB_STRIPE_KEY);
|
||||||
|
|
||||||
paymentState = "fetching";
|
paymentState = "fetching";
|
||||||
const res = await fetch(`${PUB_DONATION_URL}/billing`, {
|
const res = await fetch(`${PUB_DONATION_URL}/billing`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
@ -90,8 +90,6 @@
|
||||||
const transition = "cubic-bezier(0.23, 1, 0.320, 1)";
|
const transition = "cubic-bezier(0.23, 1, 0.320, 1)";
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
stripe = await loadStripe(PUB_STRIPE_KEY);
|
|
||||||
|
|
||||||
if (!isOfficial) {
|
if (!isOfficial) {
|
||||||
log(
|
log(
|
||||||
["about", "donate"],
|
["about", "donate"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue