aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-11-04 12:09:05 +0100
committerMiodec <[email protected]>2024-11-04 14:28:46 +0100
commita5cd1d38e4b14430e54241da53b09af184d0fc96 (patch)
treed043289b7d5bd080c6a66350473fe2b615860dbe /frontend
parent9306e1ecf5db921b828d84b0ad8e3157dcda1d02 (diff)
downloadmonkeytype-a5cd1d38e4b14430e54241da53b09af184d0fc96.tar.gz
monkeytype-a5cd1d38e4b14430e54241da53b09af184d0fc96.zip
impr: remove report button when viewing your own public profile
closes #5998
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/ts/elements/profile.ts7
1 files changed, 7 insertions, 0 deletions
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;