Skip to content

Commit 8e8f048

Browse files
committed
made changes to username availability message
1 parent a52d5ac commit 8e8f048

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

public/src/client/register.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)