File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -116,11 +116,12 @@ define('forum/register', [
116116
117117 function validateUsername ( username , callback ) {
118118 callback = callback || function ( ) { } ;
119-
119+
120120 const username_notify = $ ( '#username-notify' ) ;
121121 username_notify . text ( '' ) ;
122122 const usernameInput = $ ( '#username' ) ;
123123 const userslug = slugify ( username ) ;
124+
124125 if ( username . length < ajaxify . data . minimumUsernameLength || userslug . length < ajaxify . data . minimumUsernameLength ) {
125126 showError ( usernameInput , username_notify , '[[error:username-too-short]]' ) ;
126127 } else if ( username . length > ajaxify . data . maximumUsernameLength ) {
@@ -135,13 +136,19 @@ define('forum/register', [
135136 if ( results . every ( obj => obj . status === 'rejected' ) ) {
136137 showSuccess ( usernameInput , username_notify , successIcon ) ;
137138 } else {
138- showError ( usernameInput , username_notify , '[[error:username-taken]]' ) ;
139+ const suggestion = username + '123' ;
140+ showError (
141+ usernameInput ,
142+ username_notify ,
143+ `[[error:username-taken]] — try "<strong>${ suggestion } </strong>"`
144+ ) ;
139145 }
140-
146+
141147 callback ( ) ;
142148 } ) ;
143149 }
144150 }
151+
145152
146153 function validatePassword ( password , password_confirm ) {
147154 const passwordInput = $ ( '#password' ) ;
You can’t perform that action at this time.
0 commit comments