mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 17:56:09 +08:00
impr(reporting): dont allow reporting for suspected cheating if user has opted out of leaderboards
This commit is contained in:
parent
7326ff0985
commit
b8e647d38d
3 changed files with 5 additions and 2 deletions
|
|
@ -25,6 +25,7 @@ export async function update(
|
|||
|
||||
profileElement.attr("uid", profile.uid ?? "");
|
||||
profileElement.attr("name", profile.name ?? "");
|
||||
profileElement.attr("lbOptOut", `${profile.lbOptOut ?? false}`);
|
||||
|
||||
// ============================================================================
|
||||
// DO FREAKING NOT USE .HTML OR .APPEND HERE - USER INPUT!!!!!!
|
||||
|
|
|
|||
|
|
@ -195,8 +195,10 @@ async function update(options: UpdateOptions): Promise<void> {
|
|||
$(".page.pageProfile").on("click", ".profile .userReportButton", () => {
|
||||
const uid = $(".page.pageProfile .profile").attr("uid") ?? "";
|
||||
const name = $(".page.pageProfile .profile").attr("name") ?? "";
|
||||
const lbOptOut =
|
||||
($(".page.pageProfile .profile").attr("lbOptOut") ?? "false") === "true";
|
||||
|
||||
UserReportPopup.show({ uid, name });
|
||||
UserReportPopup.show({ uid, name, lbOptOut });
|
||||
});
|
||||
|
||||
export const page = new Page<undefined | Profile.ProfileData>(
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ async function submitReport(): Promise<void> {
|
|||
|
||||
if (reason === "Suspected cheating" && state.lbOptOut) {
|
||||
return Notifications.add(
|
||||
"You cannot report this user for suspected cheating as they have opted out of the leaderboard.",
|
||||
"You cannot report this user for suspected cheating as they have opted out of the leaderboards.",
|
||||
0,
|
||||
{
|
||||
duration: 10,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue