From a5cd1d38e4b14430e54241da53b09af184d0fc96 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 4 Nov 2024 12:09:05 +0100 Subject: [PATCH] impr: remove report button when viewing your own public profile closes #5998 --- frontend/src/ts/elements/profile.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/ts/elements/profile.ts b/frontend/src/ts/elements/profile.ts index 7cb650581..2abdf826d 100644 --- a/frontend/src/ts/elements/profile.ts +++ b/frontend/src/ts/elements/profile.ts @@ -14,6 +14,7 @@ import Format from "../utils/format"; import { UserProfile, RankAndCount } from "@monkeytype/contracts/schemas/users"; import { abbreviateNumber, convertRemToPixels } from "../utils/numbers"; import { secondsToString } from "../utils/date-and-time"; +import { Auth } from "../firebase"; type ProfileViewPaths = "profile" | "account"; type UserProfileOrSnapshot = UserProfile | DB.Snapshot; @@ -331,6 +332,12 @@ export async function update( } } + if (profile.uid === Auth?.currentUser?.uid) { + profileElement.find(".userReportButton").addClass("hidden"); + } else { + profileElement.find(".userReportButton").removeClass("hidden"); + } + //structure const bioAndKey = bio || keyboard;