Limit the size of the usernames to 32 chars

pull/1/head
Yann Flory 9 years ago
parent 38d797a4f1
commit de6db0285c

@ -145,7 +145,11 @@ define([
buttonElmt.addEventListener("click", function() { buttonElmt.addEventListener("click", function() {
var newName = prompt("Change your name :", myUserName) var newName = prompt("Change your name :", myUserName)
if (newName && newName.trim()) { if (newName && newName.trim()) {
myUserName = newName.trim(); var myUserNameTemp = newName.trim();
if(newName.trim().length > 32) {
myUserNameTemp = myUserNameTemp.substr(0, 31);
}
myUserName = myUserNameTemp;
myData[myID] = { myData[myID] = {
name: myUserName name: myUserName
}; };

Loading…
Cancel
Save