aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/popup.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-09-01 15:15:30 -0400
committerAjay <[email protected]>2022-09-01 15:15:30 -0400
commitc6e30236e973e7764582bf7a0b8f0f10bdc73fbb (patch)
tree52bded8a60ca682bfa81ce77bcd1486e8b911ee9 /src/popup.ts
parent34c4ecf9409eeb13b731c59e62e3d62b13e5b5c1 (diff)
downloadSponsorBlock-c6e30236e973e7764582bf7a0b8f0f10bdc73fbb.tar.gz
SponsorBlock-c6e30236e973e7764582bf7a0b8f0f10bdc73fbb.zip
Add license requirement
Diffstat (limited to 'src/popup.ts')
-rw-r--r--src/popup.ts9
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");
+ }
}
});