prevent self showing up on realtime problem

This commit is contained in:
Connor Turland 2014-09-15 22:04:44 -04:00
parent b6893d8f92
commit f62ca67d9f

View file

@ -1591,6 +1591,7 @@ Metamaps.Realtime = {
mapperListItem += '<div class="littleJuntoIcon"></div>'; mapperListItem += '<div class="littleJuntoIcon"></div>';
mapperListItem += '</li>'; mapperListItem += '</li>';
if (data.userid !== Metamaps.Active.Mapper.id) {
$('#mapper' + data.userid).remove(); $('#mapper' + data.userid).remove();
$('.realtimeMapperList ul').append(mapperListItem); $('.realtimeMapperList ul').append(mapperListItem);
@ -1601,6 +1602,7 @@ Metamaps.Realtime = {
text: data.username, text: data.username,
class: 'collabCompass' class: 'collabCompass'
}).appendTo('#wrapper'); }).appendTo('#wrapper');
}
}, },
newPeerOnMap: function (data) { newPeerOnMap: function (data) {
var self = Metamaps.Realtime; var self = Metamaps.Realtime;
@ -1617,6 +1619,7 @@ Metamaps.Realtime = {
}; };
// create an item for them in the realtime box // create an item for them in the realtime box
if (data.userid !== Metamaps.Active.Mapper.id) {
var mapperListItem = '<li id="mapper' + data.userid + '" class="rtMapper littleRtOn">'; var mapperListItem = '<li id="mapper' + data.userid + '" class="rtMapper littleRtOn">';
mapperListItem += '<img src="' + data.userimage + '" width="24" height="24" class="rtUserImage" />'; mapperListItem += '<img src="' + data.userimage + '" width="24" height="24" class="rtUserImage" />';
mapperListItem += data.username; mapperListItem += data.username;
@ -1645,6 +1648,7 @@ Metamaps.Realtime = {
mapid: Metamaps.Active.Map.id mapid: Metamaps.Active.Map.id
}; };
socket.emit('updateNewMapperList', update); socket.emit('updateNewMapperList', update);
}
}, },
lostPeerOnMap: function (data) { lostPeerOnMap: function (data) {
var self = Metamaps.Realtime; var self = Metamaps.Realtime;