aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-12-15 22:01:28 -0500
committerAjay Ramachandran <[email protected]>2021-12-15 22:01:28 -0500
commit54001763a78ec17a060161417293c6accfb66fe0 (patch)
treee7eaf8a7db8000244da9f71c6c702761d1f796d6
parent1c911581db2f617a4ae6f46c0eb53c840911a618 (diff)
downloadSponsorBlock-54001763a78ec17a060161417293c6accfb66fe0.tar.gz
SponsorBlock-54001763a78ec17a060161417293c6accfb66fe0.zip
Don't hide userID option if not set
Fix #1025
-rw-r--r--src/options.ts20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/options.ts b/src/options.ts
index 8c5c3bca..b345037a 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -512,15 +512,17 @@ 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");
- }
- });
+ if (Config.config[option]) {
+ 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;
}