Browse Source

add fallback to peer alias if there is no profile.fullname specified in redraw profile functions

readme-update
Simon Grim 6 years ago
parent
commit
e51032a53d
  1. 6
      js/twister_actions.js

6
js/twister_actions.js

@ -556,6 +556,9 @@ function loadAvatarForEdit(peerAlias, req) {
function redrawProfileAndAvatar(peerAlias, profileData, avatarData) { function redrawProfileAndAvatar(peerAlias, profileData, avatarData) {
var containerElem; var containerElem;
if (!profileData.fullname)
profileData.fullname = peerAlias;
if (peerAlias === defaultScreenName) { if (peerAlias === defaultScreenName) {
containerElem = $('.module .mini-profile-info, .userMenu .mini-profile-info'); containerElem = $('.module .mini-profile-info, .userMenu .mini-profile-info');
containerElem.find('.mini-profile-name').text(profileData.fullname); containerElem.find('.mini-profile-name').text(profileData.fullname);
@ -614,6 +617,9 @@ function redrawProfileAndAvatar(peerAlias, profileData, avatarData) {
function redrawProfile(peerAlias, profileData) { function redrawProfile(peerAlias, profileData) {
var containerElem; var containerElem;
if (!profileData.fullname)
profileData.fullname = peerAlias;
if (peerAlias === defaultScreenName) if (peerAlias === defaultScreenName)
$('.module .mini-profile-info, .userMenu .mini-profile-info') $('.module .mini-profile-info, .userMenu .mini-profile-info')
.find('.mini-profile-name').text(profileData.fullname); .find('.mini-profile-name').text(profileData.fullname);

Loading…
Cancel
Save