From a5891bb4c009fa3b084867e7fc722a76fc78be58 Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 28 Jun 2023 18:29:51 +0200 Subject: [PATCH] Fix user labels not being applied to anonymous usernames. --- source/content-scripts/features/user-labels.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/content-scripts/features/user-labels.tsx b/source/content-scripts/features/user-labels.tsx index ae52af6..82e9086 100644 --- a/source/content-scripts/features/user-labels.tsx +++ b/source/content-scripts/features/user-labels.tsx @@ -80,9 +80,7 @@ export class UserLabelsFeature extends Component { }); for (const element of elements) { - let username: string = element - .textContent!.replace(/@/g, "") - .toLowerCase(); + let username: string = element.textContent!.replace(/@/g, ""); if (this.props.anonymizeUsernamesEnabled) { username = element.dataset.trxUsername ?? username; @@ -90,7 +88,7 @@ export class UserLabelsFeature extends Component { const userLabels = sortedLabels.filter( ({value}) => - value.username.toLowerCase() === username && + value.username.toLowerCase() === username.toLowerCase() && (onlyID === undefined ? true : value.id === onlyID), );