changed where online users name logic is so it catches all cases.

This commit is contained in:
Henry Oswald 2014-12-08 18:56:46 +00:00
parent 70d0af519b
commit 611916119a

View file

@ -21,16 +21,14 @@ define [
# Don't store myself
continue
# Store data in the same format returned by clientTracking.clientUpdated
if user.first_name?.length == 0 and user.last_name.length == 0
name = user.email
else
name = "#{user.first_name} #{user.last_name}"
@$scope.onlineUsers[user.client_id] = {
id: user.client_id
user_id: user.user_id
email: user.email
name: name
name: user.first_name
doc_id: user.cursorData?.doc_id
row: user.cursorData?.row
column: user.cursorData?.column
@ -57,8 +55,12 @@ define [
for client_id, user of @$scope.onlineUsers
if user.doc_id?
user.doc = @ide.fileTreeManager.findEntityById(user.doc_id)
if user.first_name?.length == 0 and user.last_name.length == 0
user.name = user.email
else
user.name = "#{user.first_name} #{user.last_name}"
@$scope.onlineUsersArray.push user
@$scope.onlineUserCursorHighlights = {}
for client_id, client of @$scope.onlineUsers
doc_id = client.doc_id