Skip to content

Commit

Permalink
Some more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hopperelec committed Oct 24, 2023
1 parent ed4b3d5 commit 2f302e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions report/components/core/labels/AuthorLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ const _AuthorLabel = ({ index }: LabelProps) => {

// add discriminator in Discord
if (db.config.platform === "discord") {
let n = author.n;
let discr = n.split("#").pop();
const discr = author.n.split("#").pop();

// only keep if it's 4 chars (and not a deleted ID)
if (discr && discr.length === 4) {
discr = parseInt(discr).toString();
n = n.slice(0, -5);
name = (
<>
{n}
{discr && <span className="Label__discriminator">#{`${isDemo ? 0 : discr}`.padStart(4, "0")}</span>}
{author.n.slice(0, -5)}
<span className="Label__discriminator">#{`${isDemo ? "0000" : discr}`}</span>
</>
);
}
Expand Down

0 comments on commit 2f302e1

Please sign in to comment.