fix undefined currency

paypal-app-refactor
Alan 2023-09-29 13:07:21 -07:00
parent ade7f30f31
commit a722836b70
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
const pathname = usePathname(); const pathname = usePathname();
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>(); const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
const price = getAppData("price"); const price = getAppData("price");
const currency = getAppData("currency"); const currency = getAppData("currency") || currencyOptions[0].value;
const [selectedCurrency, setSelectedCurrency] = useState( const [selectedCurrency, setSelectedCurrency] = useState(
currencyOptions.find((c) => c.value === currency) || { currencyOptions.find((c) => c.value === currency) || {
label: currencyOptions[0].label, label: currencyOptions[0].label,