Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ts/state/ducks/proBackendData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ async function handleExpiryCTAs(
const proExpiringSoonCTA = !isUndefined(Storage.get(SettingsKey.proExpiringSoonCTA));
const proExpiredCTA = !isUndefined(Storage.get(SettingsKey.proExpiredCTA));

// Remove the pro expired cta item if the user gets pro again
if (status === ProStatus.Active && proExpiredCTA) {
await Storage.remove(SettingsKey.proExpiredCTA);
}

if (now < sevenDaysBeforeExpiry) {
// More than 7 days before expiry, remove CTA items if they exist. This means the items were set for a previous cycle of pro access.
if (proExpiringSoonCTA) {
Expand All @@ -229,6 +234,10 @@ async function handleExpiryCTAs(
// Between expiry and 30 days after expiry, Expired CTA needs to be marked to be shown if not already
if (status === ProStatus.Expired && !proExpiredCTA) {
await Storage.put(SettingsKey.proExpiredCTA, true);
// The expiring soon CTA should be removed if it's set as we want to show it again in the future if needed
if (proExpiringSoonCTA) {
await Storage.remove(SettingsKey.proExpiringSoonCTA);
}
}
}
}
Expand Down