From d69bd6a33fb47de1bc0a118f7e69e5eb701c0048 Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 18 Aug 2024 13:11:30 -0400 Subject: [PATCH] Allow instant free access --- src/help/PaymentComponent.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/help/PaymentComponent.tsx b/src/help/PaymentComponent.tsx index bec53fa..61854ac 100644 --- a/src/help/PaymentComponent.tsx +++ b/src/help/PaymentComponent.tsx @@ -11,6 +11,7 @@ interface PaymentComponentChoices { freeTrial?: boolean; licenseKey?: string; freeAccess?: boolean; + freeInstantAccess?: boolean; freeAccessWaitingPeriod? : number; } @@ -64,10 +65,15 @@ export const PaymentComponent = () => { } if (choices.freeAccess) { - Config.config!.freeAccessRequestStart = Date.now(); - - if (choices.freeAccessWaitingPeriod) { - Config.config!.freeAccessWaitingPeriod = choices.freeAccessWaitingPeriod; + if (choices.freeInstantAccess) { + Config.config!.activated = true; + Config.config!.freeActivation = true; + } else { + Config.config!.freeAccessRequestStart = Date.now(); + + if (choices.freeAccessWaitingPeriod) { + Config.config!.freeAccessWaitingPeriod = choices.freeAccessWaitingPeriod; + } } } @@ -85,7 +91,7 @@ export const PaymentComponent = () => { window.scrollTo(0, 0); } - if (validLicenseKey || choices.freeTrial) { + if (validLicenseKey || choices.freeTrial || Config.config!.activated) { await askBackgroundToRegisterNeededContentScripts(true); } else if (choices.freeAccess) { setTimeout(() => void askBackgroundToSetupAlarms(), 2000);