diff --git a/src/util/subscriptions/storage.ts b/src/util/subscriptions/storage.ts index b0f5459c1a..f02d5f3032 100644 --- a/src/util/subscriptions/storage.ts +++ b/src/util/subscriptions/storage.ts @@ -169,27 +169,16 @@ export async function checkStatus(feature: PremiumPlans) { currentStatusStorage[COUNTER_STORAGE_KEY] != null ? currentStatusStorage[COUNTER_STORAGE_KEY] : DEFAULT_COUNTER_STORAGE_KEY - const currentDate = new Date(Date.now()) - const currentMonth = currentDate.getMonth() if ((await enforceTrialPeriod30Days()) === true) { return true } - // if (currentStatus.m !== currentMonth) { - // await browser.storage.local.set({ - // [COUNTER_STORAGE_KEY]: { - // c: currentStatus.c, - // cQ: currentStatus.cQ, - // m: currentMonth, - // }, - // }) - // } - if (feature === 'bookmarksPowerUp') { const hasBookmarkPowerUp = (currentStatus.pU?.Unlimited || - currentStatus.pU?.bookmarksPowerUp) ?? + currentStatus.pU?.bookmarksPowerUp || + currentStatus.pU?.lifetime) ?? false if (hasBookmarkPowerUp) { @@ -199,10 +188,12 @@ export async function checkStatus(feature: PremiumPlans) { if (currentCounter < 25) { return true } + return false } } if (feature === 'AIpowerup') { - const hasAIPowerUp = currentStatus.pU?.AIpowerup ?? false + const hasAIPowerUp = + (currentStatus.pU?.AIpowerup || currentStatus.pU?.lifetime) ?? false if (hasAIPowerUp) { return true @@ -211,11 +202,14 @@ export async function checkStatus(feature: PremiumPlans) { if (currentCounter < 25) { return true } + return false } } if (feature === 'AIpowerupOwnKey') { const hasAIPowerUp = - (currentStatus.pU.AIpowerupOwnKey || currentStatus.pU.AIpowerup) ?? + (currentStatus.pU.AIpowerupOwnKey || + currentStatus.pU.AIpowerup || + currentStatus.pU?.lifetime) ?? false if (hasAIPowerUp) { @@ -225,9 +219,10 @@ export async function checkStatus(feature: PremiumPlans) { if (currentCounter < 25) { return true } + return false } } - return false + return true } export async function pageActionAllowed(