Checks whether we need to modify document, before change - on display name change.

This commit is contained in:
damencho 2016-04-09 12:04:01 -05:00
parent 4d63ea2021
commit 613569ff09
2 changed files with 6 additions and 2 deletions

View File

@ -153,12 +153,14 @@ var ContactList = {
}, },
onDisplayNameChange (id, displayName) { onDisplayNameChange (id, displayName) {
if(!displayName)
return;
if (id === 'localVideoContainer') { if (id === 'localVideoContainer') {
id = APP.conference.localId; id = APP.conference.localId;
} }
let contactName = $(`#contacts #${id}>p`); let contactName = $(`#contacts #${id}>p`);
if (displayName) { if (contactName.text() !== displayName) {
contactName.text(displayName); contactName.text(displayName);
} }
}, },

View File

@ -357,7 +357,9 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) {
// If we already have a display name for this video. // If we already have a display name for this video.
if (nameSpan.length > 0) { if (nameSpan.length > 0) {
if (displayName && displayName.length > 0) { if (displayName && displayName.length > 0) {
$('#' + this.videoSpanId + '_name').text(displayName); var displaynameSpan = $('#' + this.videoSpanId + '_name');
if (displaynameSpan.text() !== displayName)
displaynameSpan.text(displayName);
} }
else if (key && key.length > 0) { else if (key && key.length > 0) {
var nameHtml = APP.translation.generateTranslationHTML(key); var nameHtml = APP.translation.generateTranslationHTML(key);