Recheck the agreement before opening the store purchase sheet [skip ci]

This commit is contained in:
Maurice
2026-12-02 16:33:34 +01:00
parent bf6a66d52c
commit e54f954f31
4 changed files with 164 additions and 13 deletions
+15
View File
@@ -29,6 +29,21 @@ export function isNewCloudPlan(id: string): boolean {
return id === 'start' || id === 'plus';
}
export interface CloudPurchaseAgreement {
version: string;
text: string;
}
/** Recheck the agreement before opening the store sheet. No agreement means no new purchase. */
export function matchesPurchaseAgreement(
accepted: CloudPurchaseAgreement | null,
current: CloudPurchaseAgreement | null
): boolean {
return (
accepted !== null && current !== null && accepted.version === current.version && accepted.text === current.text
);
}
const PLAN_NAMES: Record<string, string> = { start: 'Start', basis: 'Basis', plus: 'Plus', pro: 'Pro' };
/** A verified purchase can predate the current offer and still need its instance set up. */