Refactor some code (#3205)

This commit is contained in:
Bruce Berrios 2022-06-22 20:01:48 -04:00 committed by GitHub
parent 4a0db5c14e
commit 8144ea9077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);