Follow-up I60e550ef: Don't show relevant user in mention list if it is you

We have logic above to exclude mentioning yourself, but this
is overridden if you are commenting on your own talk page.

Change-Id: I2858c79bd9f1cb733f105825e17f9df75859e40a
This commit is contained in:
Ed Sanders 2021-03-04 20:59:00 +00:00
parent f296c6fdd9
commit 998bd206ae

View file

@ -36,7 +36,11 @@ function MWUsernameCompletionAction( surface ) {
action.localUsers.push( user );
}
} );
if ( relevantUserName && this.localUsers.indexOf( relevantUserName ) === -1 ) {
if (
relevantUserName &&
relevantUserName !== mw.user.getName() &&
this.localUsers.indexOf( relevantUserName ) === -1
) {
this.localUsers.push( relevantUserName );
this.localUsers.sort();
}