diff options
author | Ajay Ramachandran <[email protected]> | 2021-08-05 20:11:56 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-08-05 20:11:56 -0400 |
commit | 668b956bb77e87a92da6ed4e228b40ce21dbb2da (patch) | |
tree | e268b0db05f658967313753fb6e8d5255ff6f11b | |
parent | 7b54b79f2767d9c6d51aae7f504351d39debcc70 (diff) | |
download | SponsorBlock-668b956bb77e87a92da6ed4e228b40ce21dbb2da.tar.gz SponsorBlock-668b956bb77e87a92da6ed4e228b40ce21dbb2da.zip |
Don't allow changing userID if warned
-rw-r--r-- | src/options.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/options.ts b/src/options.ts index 50436b4f..ee04f1a5 100644 --- a/src/options.ts +++ b/src/options.ts @@ -492,6 +492,22 @@ function activatePrivateTextChange(element: HTMLElement) { } }); + // See if anything extra must be done + switch (option) { + case "userID": + utils.asyncRequestToServer("GET", "/api/userInfo", { + userID: Config.config[option], + values: ["warnings", "banned"] + }).then((result) => { + const userInfo = JSON.parse(result.responseText); + if (userInfo.warnings > 0 || userInfo.banned) { + setButton.classList.add("hidden"); + } + }); + + break; + } + element.querySelector(".option-hidden-section").classList.remove("hidden"); } |