diff options
Diffstat (limited to 'src/popup.ts')
-rw-r--r-- | src/popup.ts | 9 |
1 files changed, 8 insertions, 1 deletions
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<void> { 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<void> { 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"); + } } }); |