Don't allow changing userID if warned

This commit is contained in:
Ajay Ramachandran
2021-08-05 20:11:56 -04:00
parent 7b54b79f27
commit 668b956bb7

View File

@@ -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");
}