From 248e1497013733d83578cf759518f798e854aad0 Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Thu, 14 May 2026 09:55:44 +0100 Subject: [PATCH] Default interstitial to monthly plans (#33706) * Default interstitial to monthly plans except for upgrade, which defaults to user's existing subscription period * Add tests for interstitial page period toggle defaults GitOrigin-RevId: fa0ac41e7d8a7bf858b53e0940287b28ef21253d --- .../app/src/Features/Subscription/PlansLocator.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Subscription/PlansLocator.mjs b/services/web/app/src/Features/Subscription/PlansLocator.mjs index 281fbb329f..2f34492425 100644 --- a/services/web/app/src/Features/Subscription/PlansLocator.mjs +++ b/services/web/app/src/Features/Subscription/PlansLocator.mjs @@ -120,10 +120,19 @@ const recurlyPlanCodeToPlanTypeAndPeriod = { } /** - * @param {RecurlyPlanCode} recurlyPlanCode + * @param {string} key + * @returns {key is RecurlyPlanCode} + */ +function isRecurlyPlanCode(key) { + return Object.hasOwn(recurlyPlanCodeToPlanTypeAndPeriod, key) +} + +/** + * @param {string} recurlyPlanCode * @returns {PlanTypeAndPeriod | undefined} */ function getPlanTypeAndPeriodFromRecurlyPlanCode(recurlyPlanCode) { + if (!isRecurlyPlanCode(recurlyPlanCode)) return undefined return recurlyPlanCodeToPlanTypeAndPeriod[recurlyPlanCode] }