From ad6a66edcc9d2dfb14cdb2591d99364779d54b73 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 1 Jan 2024 15:33:10 -0800 Subject: [PATCH] Update PromoCard2 for new API --- src/components/ui4/PromoCardUi4.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ui4/PromoCardUi4.tsx b/src/components/ui4/PromoCardUi4.tsx index 93b0e9ac317..2568573d36b 100644 --- a/src/components/ui4/PromoCardUi4.tsx +++ b/src/components/ui4/PromoCardUi4.tsx @@ -35,7 +35,12 @@ export function PromoCardUi4Component(props: Props) { const handlePress = useHandler(() => { if (ctaButton == null) return - const { url } = ctaButton + const { localeUrls } = ctaButton + const url = getLocaleOrDefaultString(localeUrls) + if (url == null) { + showError('No PromoCard URL found') + return + } dispatch(linkReferralWithCurrencies(navigation, url)).catch(err => showError(err)) })