Permalink
Browse files

Fixed nickaname reassignment logic.

  • Loading branch information...
1 parent 92a05d3 commit 526dc5be8602e4755d76daead459747d8f6c0933 Paul Maxan committed Apr 21, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 public/js/app.js
View
6 public/js/app.js
@@ -230,8 +230,12 @@ $(document).ready(function() {
message = message.replace(/(https?:\/\/[-_.a-zA-Z0-9&?\/=\[\]()$!#+:]+)/g, "<a href=\"$1\" target=\"_BLANK\">$1</a>");
break;
case "reconnecting":
+ if (iReconnectPostpendCount == 0) {
+ nickname = nickname + iReconnectPostpendCount;
+ } else {
+ nickname = nickname.substring(0, nickname.length-1) + (iReconnectPostpendCount % 10);
+ }
iReconnectPostpendCount++;
- nickname = nickname + iReconnectPostpendCount;
message = '<span class="msg-disconnected">Reconnecting as ' + nickname + '...</span>';
break;
case "disconnected":

0 comments on commit 526dc5b

Please sign in to comment.