From 8144ea9077aed75f826c251d628110057272100f Mon Sep 17 00:00:00 2001 From: Bruce Berrios <58147810+Bruception@users.noreply.github.com> Date: Wed, 22 Jun 2022 20:01:48 -0400 Subject: [PATCH] Refactor some code (#3205) --- frontend/src/ts/elements/profile.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/ts/elements/profile.ts b/frontend/src/ts/elements/profile.ts index 0ee328951..e7939a6e4 100644 --- a/frontend/src/ts/elements/profile.ts +++ b/frontend/src/ts/elements/profile.ts @@ -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);