Add premium logo next to username on result screenshots

This commit is contained in:
Christian Fehmer 2024-01-05 13:37:09 +01:00
parent 2459908412
commit 759c881fd1
No known key found for this signature in database
GPG key ID: 7294582286D5F1F4

View file

@ -21,6 +21,7 @@ import * as FunboxList from "./funbox/funbox-list";
import { debounce } from "throttle-debounce";
import * as ResultWordHighlight from "../elements/result-word-highlight";
import * as ActivePage from "../states/active-page";
import * as BadgeController from "../controllers/badge-controller";
const debouncedZipfCheck = debounce(250, () => {
Misc.checkIfLanguageSupportsZipf(Config.language).then((supports) => {
@ -445,11 +446,15 @@ export async function screenshot(): Promise<void> {
format(dateNow, "dd MMM yyyy HH:mm") + " | monkeytype.com "
);
if (Auth?.currentUser) {
$(".pageTest .ssWatermark").text(
DB.getSnapshot()?.name +
" | " +
format(dateNow, "dd MMM yyyy HH:mm") +
" | monkeytype.com "
const name = DB.getSnapshot()?.name;
const currentDate = format(dateNow, "dd MMM yyyy HH:mm");
let icon = "";
if (DB.getSnapshot()?.isPremium) {
icon = `<i class="fa ${BadgeController.getById(15).icon}"></i> `;
}
$(".pageTest .ssWatermark").html(
`${name} ${icon}| ${currentDate} | monkeytype.com`
);
}
$(".pageTest .buttons").addClass("hidden");