From c6e30236e973e7764582bf7a0b8f0f10bdc73fbb Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 1 Sep 2022 15:15:30 -0400 Subject: Add license requirement --- src/popup.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/popup.ts') diff --git a/src/popup.ts b/src/popup.ts index 9d60b058..60c875a1 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -255,7 +255,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { PageElements.showNoticeAgain.style.display = "unset"; } - utils.sendRequestToServer("GET", "/api/userInfo?value=userName&value=viewCount&value=minutesSaved&value=vip&value=permissions&userID=" + utils.sendRequestToServer("GET", "/api/userInfo?value=userName&value=viewCount&value=minutesSaved&value=vip&value=permissions&value=freeChaptersAccess&userID=" + Config.config.userID, (res) => { if (res.status === 200) { const userInfo = JSON.parse(res.responseText); @@ -286,6 +286,13 @@ async function runThePopup(messageListener?: MessageListener): Promise { Config.config.isVip = userInfo.vip; Config.config.permissions = userInfo.permissions; + + if (userInfo.freeChaptersAccess) { + Config.config.payments.chaptersAllowed = userInfo.freeChaptersAccess; + Config.config.payments.freeAccess = userInfo.freeChaptersAccess; + Config.config.payments.lastCheck = Date.now(); + Config.forceSyncUpdate("payments"); + } } }); -- cgit v1.2.3