1
Fork 0

Fix user labels not being applied to anonymous usernames.

This commit is contained in:
Bauke 2023-06-28 18:29:51 +02:00
parent 126960ba82
commit a5891bb4c0
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 2 additions and 4 deletions

View File

@ -80,9 +80,7 @@ export class UserLabelsFeature extends Component<Props, State> {
}); });
for (const element of elements) { for (const element of elements) {
let username: string = element let username: string = element.textContent!.replace(/@/g, "");
.textContent!.replace(/@/g, "")
.toLowerCase();
if (this.props.anonymizeUsernamesEnabled) { if (this.props.anonymizeUsernamesEnabled) {
username = element.dataset.trxUsername ?? username; username = element.dataset.trxUsername ?? username;
@ -90,7 +88,7 @@ export class UserLabelsFeature extends Component<Props, State> {
const userLabels = sortedLabels.filter( const userLabels = sortedLabels.filter(
({value}) => ({value}) =>
value.username.toLowerCase() === username && value.username.toLowerCase() === username.toLowerCase() &&
(onlyID === undefined ? true : value.id === onlyID), (onlyID === undefined ? true : value.id === onlyID),
); );