fix: only set stripe app data if it requires payment (#11623)

Co-authored-by: alannnc <alannnc@gmail.com>
This commit is contained in:
Roland 2023-09-30 01:49:52 +07:00 committed by GitHub
parent 41b6377f29
commit e568d70e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,13 +48,15 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
.trim();
useEffect(() => {
if (!getAppData("currency")) {
setAppData("currency", currencyOptions[0].value);
if (requirePayment) {
if (!getAppData("currency")) {
setAppData("currency", currencyOptions[0].value);
}
if (!getAppData("paymentOption")) {
setAppData("paymentOption", paymentOptions[0].value);
}
}
if (!getAppData("paymentOption")) {
setAppData("paymentOption", paymentOptions[0].value);
}
}, []);
}, [requirePayment, getAppData, setAppData]);
return (
<AppCard