diff --git a/apps/mobile/app/components/paywall/index.tsx b/apps/mobile/app/components/paywall/index.tsx index a007769d5..6f7a7bca5 100644 --- a/apps/mobile/app/components/paywall/index.tsx +++ b/apps/mobile/app/components/paywall/index.tsx @@ -940,19 +940,22 @@ const PricingPlanCard = ({ regionalDiscount?.sku || `notesnook.${plan.id}.${annualBilling ? "yearly" : "monthly"}` ]; - const price = pricingPlans?.getPrice( - product as RNIap.Subscription, - pricingPlans.hasTrialOffer(plan.id, product?.productId) ? 1 : 0, - annualBilling - ); const WebPlan = pricingPlans?.getWebPlan( plan.id, annualBilling ? "yearly" : "monthly" ); + const price = pricingPlans?.getPrice( + pricingPlans.isGithubRelease && WebPlan + ? WebPlan + : (product as RNIap.Subscription), + pricingPlans.hasTrialOffer(plan.id, product?.productId) ? 1 : 0, + annualBilling + ); + useEffect(() => { - if (pricingPlans?.isGithubRelease) return; + if (pricingPlans?.isGithubRelease || !annualBilling) return; pricingPlans ?.getRegionalDiscount( plan.id, @@ -963,7 +966,13 @@ const PricingPlanCard = ({ .then((value) => { setRegionaDiscount(value); }); - }, []); + }, [annualBilling]); + + useEffect(() => { + if (!annualBilling) { + setRegionaDiscount(undefined); + } + }, [annualBilling]); const isSubscribed = product?.productId && @@ -994,8 +1003,8 @@ const PricingPlanCard = ({ : "monthly" }` : pricingPlans.isGithubRelease - ? (WebPlan?.period as string) - : (product?.productId as string) + ? (WebPlan?.period as string) + : (product?.productId as string) ); setStep(Steps.buy); }} @@ -1117,12 +1126,12 @@ const PricingPlanCard = ({ {annualBilling ? strings.billedAnnually( pricingPlans?.getStandardPrice( - (product as RNIap.Subscription) || (WebPlan as Plan) + (product || WebPlan) as any ) as string ) : strings.billedMonthly( pricingPlans?.getStandardPrice( - (product as RNIap.Subscription) || (WebPlan as Plan) + (product || WebPlan) as any ) as string )} diff --git a/apps/mobile/app/components/sheets/buy-plan/index.tsx b/apps/mobile/app/components/sheets/buy-plan/index.tsx index 0692a2312..e073e599f 100644 --- a/apps/mobile/app/components/sheets/buy-plan/index.tsx +++ b/apps/mobile/app/components/sheets/buy-plan/index.tsx @@ -73,6 +73,13 @@ export const BuyPlan = (props: { }} > {strings.finishPurchaseInBrowser()} +