mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-18 13:21:21 +08:00
Refactor some code (#3205)
This commit is contained in:
parent
4a0db5c14e
commit
8144ea9077
1 changed files with 5 additions and 5 deletions
|
|
@ -41,12 +41,12 @@ export async function update(
|
|||
if (profile.badgeIds && !banned) {
|
||||
const firstBadgeId = profile.badgeIds[0];
|
||||
const restOfBadges = profile.badgeIds.filter((bid) => bid !== firstBadgeId);
|
||||
let restHTML = "";
|
||||
for (const bid of restOfBadges) {
|
||||
restHTML += await getHTMLById(bid, true);
|
||||
}
|
||||
const miniBadges = restOfBadges
|
||||
.map((bid) => getHTMLById(bid, true))
|
||||
.join("");
|
||||
|
||||
details.find(".badges").empty().append(getHTMLById(firstBadgeId));
|
||||
details.find(".allBadges").empty().append(restHTML);
|
||||
details.find(".allBadges").empty().append(miniBadges);
|
||||
}
|
||||
|
||||
details.find(".name").text(profile.name);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue