Fix user labels not being applied to anonymous usernames.
This commit is contained in:
parent
126960ba82
commit
a5891bb4c0
|
@ -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),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue