From 2f302e15df02412cb0734346847779c5702635ba Mon Sep 17 00:00:00 2001 From: hopperelec Date: Tue, 24 Oct 2023 02:08:50 +0100 Subject: [PATCH] Some more refactoring --- report/components/core/labels/AuthorLabel.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/report/components/core/labels/AuthorLabel.tsx b/report/components/core/labels/AuthorLabel.tsx index 7402ce24..13f3fb80 100644 --- a/report/components/core/labels/AuthorLabel.tsx +++ b/report/components/core/labels/AuthorLabel.tsx @@ -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 && #{`${isDemo ? 0 : discr}`.padStart(4, "0")}} + {author.n.slice(0, -5)} + #{`${isDemo ? "0000" : discr}`} ); }