Skip to content

Commit a5cd1d3

Browse files
committed
impr: remove report button when viewing your own public profile
closes monkeytypegame#5998
1 parent 9306e1e commit a5cd1d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/src/ts/elements/profile.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Format from "../utils/format";
1414
import { UserProfile, RankAndCount } from "@monkeytype/contracts/schemas/users";
1515
import { abbreviateNumber, convertRemToPixels } from "../utils/numbers";
1616
import { secondsToString } from "../utils/date-and-time";
17+
import { Auth } from "../firebase";
1718

1819
type ProfileViewPaths = "profile" | "account";
1920
type UserProfileOrSnapshot = UserProfile | DB.Snapshot;
@@ -331,6 +332,12 @@ export async function update(
331332
}
332333
}
333334

335+
if (profile.uid === Auth?.currentUser?.uid) {
336+
profileElement.find(".userReportButton").addClass("hidden");
337+
} else {
338+
profileElement.find(".userReportButton").removeClass("hidden");
339+
}
340+
334341
//structure
335342

336343
const bioAndKey = bio || keyboard;

0 commit comments

Comments
 (0)