mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 21:51:29 +08:00
faking leaderboard avatar if its not yet stored in the database
This commit is contained in:
parent
48e1c0febb
commit
1bc720585c
1 changed files with 9 additions and 1 deletions
|
|
@ -274,7 +274,15 @@ function fillTable(lb: LbKey, prepend?: number): void {
|
|||
|
||||
let avatar = `<div class="avatarPlaceholder"><i class="fas fa-user-circle"></i></div>`;
|
||||
|
||||
if (entry.discordAvatar && entry.discordId) {
|
||||
const snap = DB.getSnapshot();
|
||||
if (
|
||||
Auth.currentUser &&
|
||||
entry.uid === Auth.currentUser.uid &&
|
||||
snap.discordAvatar &&
|
||||
snap.discordId
|
||||
) {
|
||||
avatar = `<div class="avatar" style="background-image:url(https://cdn.discordapp.com/avatars/${snap.discordId}/${snap.discordAvatar}.png)"></div>`;
|
||||
} else if (entry.discordAvatar && entry.discordId) {
|
||||
avatar = `<div class="avatar" style="background-image:url(https://cdn.discordapp.com/avatars/${entry.discordId}/${entry.discordAvatar}.png)"></div>`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue