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
This commit is contained in:
Tim Down
2026-05-14 09:55:44 +01:00
committed by Copybot
parent 529c332159
commit 248e149701

View File

@@ -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]
}