fix: stripe selected currency (#11593)
This commit is contained in:
parent
68bd877c5b
commit
31bc586ee8
@ -556,8 +556,6 @@ export async function apiLogin(
|
|||||||
export async function setupEventWithPrice(eventType: Pick<Prisma.EventType, "id">, page: Page) {
|
export async function setupEventWithPrice(eventType: Pick<Prisma.EventType, "id">, page: Page) {
|
||||||
await page.goto(`/event-types/${eventType?.id}?tabName=apps`);
|
await page.goto(`/event-types/${eventType?.id}?tabName=apps`);
|
||||||
await page.locator("div > .ml-auto").first().click();
|
await page.locator("div > .ml-auto").first().click();
|
||||||
await page.locator(".text-black > .bg-default > div > div:nth-child(2)").first().click();
|
|
||||||
await page.getByTestId("select-option-usd").click();
|
|
||||||
await page.getByPlaceholder("Price").fill("100");
|
await page.getByPlaceholder("Price").fill("100");
|
||||||
await page.getByTestId("update-eventtype").click();
|
await page.getByTestId("update-eventtype").click();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
|
||||||
import AppCard from "@calcom/app-store/_components/AppCard";
|
import AppCard from "@calcom/app-store/_components/AppCard";
|
||||||
@ -25,8 +25,8 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
|||||||
const currency = getAppData("currency");
|
const currency = getAppData("currency");
|
||||||
const [selectedCurrency, setSelectedCurrency] = useState(
|
const [selectedCurrency, setSelectedCurrency] = useState(
|
||||||
currencyOptions.find((c) => c.value === currency) || {
|
currencyOptions.find((c) => c.value === currency) || {
|
||||||
label: "",
|
label: currencyOptions[0].label,
|
||||||
value: "",
|
value: currencyOptions[0].value,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const paymentOption = getAppData("paymentOption");
|
const paymentOption = getAppData("paymentOption");
|
||||||
@ -46,6 +46,16 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
|
|||||||
})
|
})
|
||||||
.replace(/\d/g, "")
|
.replace(/\d/g, "")
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!getAppData("currency")) {
|
||||||
|
setAppData("currency", currencyOptions[0].value);
|
||||||
|
}
|
||||||
|
if (!getAppData("paymentOption")) {
|
||||||
|
setAppData("paymentOption", paymentOptions[0].value);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppCard
|
<AppCard
|
||||||
returnTo={WEBAPP_URL + pathname + "?tabName=apps"}
|
returnTo={WEBAPP_URL + pathname + "?tabName=apps"}
|
||||||
|
Loading…
Reference in New Issue
Block a user