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;
|
text-align: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
.user-info-inner a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--link-color);
|
||||||
|
}
|
||||||
|
|
||||||
.user-info-inner h1 {
|
.user-info-inner h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
|
|
|
@ -336,10 +336,10 @@ async function updatePresence(data) {
|
||||||
const loadingOverlay = document.getElementById("loading-overlay");
|
const loadingOverlay = document.getElementById("loading-overlay");
|
||||||
if (loadingOverlay) {
|
if (loadingOverlay) {
|
||||||
loadingOverlay.innerHTML = `
|
loadingOverlay.innerHTML = `
|
||||||
<div class="error-message">
|
<div class="error-message">
|
||||||
<p>Failed to load user data.</p>
|
<p>Failed to load user data.</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
loadingOverlay.style.opacity = "1";
|
loadingOverlay.style.opacity = "1";
|
||||||
avatarWrapper.classList.add("hidden");
|
avatarWrapper.classList.add("hidden");
|
||||||
avatarImg.classList.add("hidden");
|
avatarImg.classList.add("hidden");
|
||||||
|
@ -349,17 +349,6 @@ async function updatePresence(data) {
|
||||||
return;
|
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) {
|
if (avatarImg && data.discord_user?.avatar) {
|
||||||
const newAvatarUrl = `https://cdn.discordapp.com/avatars/${data.discord_user.id}/${data.discord_user.avatar}`;
|
const newAvatarUrl = `https://cdn.discordapp.com/avatars/${data.discord_user.id}/${data.discord_user.avatar}`;
|
||||||
avatarImg.src = newAvatarUrl;
|
avatarImg.src = newAvatarUrl;
|
||||||
|
@ -371,10 +360,11 @@ async function updatePresence(data) {
|
||||||
siteIcon.href = newAvatarUrl;
|
siteIcon.href = newAvatarUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usernameEl) {
|
if (usernameEl) {
|
||||||
const username =
|
const username =
|
||||||
data.discord_user.global_name || data.discord_user.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;
|
document.title = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,6 +430,17 @@ async function updatePresence(data) {
|
||||||
updatedStatusIndicator.className = `status-indicator ${status}`;
|
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);
|
const custom = data.activities?.find((a) => a.type === 4);
|
||||||
updateCustomStatus(custom);
|
updateCustomStatus(custom);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue