re-add clan tags, never moved them after the js move
All checks were successful
Code quality checks / biome (push) Successful in 13s

This commit is contained in:
creations 2025-04-26 17:28:31 -04:00
parent bafdfb47f9
commit 94046881dd
Signed by: creations
GPG key ID: 8F553AA4320FC711
3 changed files with 81 additions and 38 deletions

View file

@ -390,6 +390,8 @@ async function updatePresence(data) {
document.title = username;
}
updateClanBadge(data);
const platform = {
mobile: data.active_on_discord_mobile,
web: data.active_on_discord_web,
@ -559,6 +561,38 @@ async function getAllNoAsset() {
}
}
function updateClanBadge(data) {
const userInfoInner = document.querySelector(".user-info-inner");
if (!userInfoInner) return;
const clan = data?.discord_user?.clan;
if (!clan || !clan.tag || !clan.identity_guild_id || !clan.badge) return;
const existing = userInfoInner.querySelector(".clan-badge");
if (existing) existing.remove();
const wrapper = document.createElement("div");
wrapper.className = "clan-badge";
const img = document.createElement("img");
img.src = `https://cdn.discordapp.com/clan-badges/${clan.identity_guild_id}/${clan.badge}`;
img.alt = "Clan Badge";
const span = document.createElement("span");
span.className = "clan-name";
span.textContent = clan.tag;
wrapper.appendChild(img);
wrapper.appendChild(span);
const usernameEl = userInfoInner.querySelector(".username");
if (usernameEl) {
usernameEl.insertAdjacentElement("afterend", wrapper);
} else {
userInfoInner.appendChild(wrapper);
}
}
if (instanceUri) {
if (!instanceUri.startsWith("http")) {
instanceUri = `https://${instanceUri}`;