move load order again, add url to username to open profile
All checks were successful
Code quality checks / biome (push) Successful in 8s
All checks were successful
Code quality checks / biome (push) Successful in 8s
This commit is contained in:
parent
6078ebf0d1
commit
f6bda95f02
2 changed files with 21 additions and 16 deletions
|
@ -248,6 +248,10 @@ body {
|
|||
text-align: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.user-info-inner a {
|
||||
text-decoration: none;
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
||||
.user-info-inner h1 {
|
||||
font-size: 2rem;
|
||||
|
|
|
@ -349,17 +349,6 @@ async function updatePresence(data) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!badgesLoaded) {
|
||||
loadBadges(userId, {
|
||||
services: [],
|
||||
seperated: true,
|
||||
cache: true,
|
||||
targetId: "badges",
|
||||
serviceOrder: ["discord", "equicord", "reviewdb", "vencord"],
|
||||
});
|
||||
badgesLoaded = true;
|
||||
}
|
||||
|
||||
if (avatarImg && data.discord_user?.avatar) {
|
||||
const newAvatarUrl = `https://cdn.discordapp.com/avatars/${data.discord_user.id}/${data.discord_user.avatar}`;
|
||||
avatarImg.src = newAvatarUrl;
|
||||
|
@ -371,10 +360,11 @@ async function updatePresence(data) {
|
|||
siteIcon.href = newAvatarUrl;
|
||||
}
|
||||
}
|
||||
|
||||
if (usernameEl) {
|
||||
const username =
|
||||
data.discord_user.global_name || data.discord_user.username;
|
||||
usernameEl.textContent = username;
|
||||
usernameEl.innerHTML = `<a href="https://discord.com/users/${data.discord_user.id}" target="_blank" rel="noopener noreferrer">${username}</a>`;
|
||||
document.title = username;
|
||||
}
|
||||
|
||||
|
@ -440,6 +430,17 @@ async function updatePresence(data) {
|
|||
updatedStatusIndicator.className = `status-indicator ${status}`;
|
||||
}
|
||||
|
||||
if (!badgesLoaded) {
|
||||
await loadBadges(userId, {
|
||||
services: [],
|
||||
seperated: true,
|
||||
cache: true,
|
||||
targetId: "badges",
|
||||
serviceOrder: ["discord", "equicord", "reviewdb", "vencord"],
|
||||
});
|
||||
badgesLoaded = true;
|
||||
}
|
||||
|
||||
const custom = data.activities?.find((a) => a.type === 4);
|
||||
updateCustomStatus(custom);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue