diff --git a/www/plugins/es/js/services/user-services.js b/www/plugins/es/js/services/user-services.js index 5f6bf2249518f37083ad27edad16a9516b797e82..1023dd85eb2b605e0fa11ffe4b3c545425b59235 100644 --- a/www/plugins/es/js/services/user-services.js +++ b/www/plugins/es/js/services/user-services.js @@ -71,7 +71,7 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se } function onWalletReset(data) { - //data.avatar = null; + data.avatar = null; data.avatarStyle = null; data.profile = null; data.name = null; @@ -92,7 +92,7 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se data.profile = res._source; if (avatar) { data.avatarStyle={'background-image':'url("'+avatar.src+'")'}; - //data.avatar=avatar; + data.avatar=avatar; delete res._source.avatar; } data.profile = res._source; @@ -171,12 +171,15 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se return; } - var uidsByPubkey; var hits; $q.all([ BMA.wot.member.uids() - .then(function(res){ - uidsByPubkey = res; + .then(function(uidsByPubkey){ + _.forEach(datas, function(data) { + if (!data.uid && data[pubkeyAtributeName]) { + data.uid = uidsByPubkey[data[pubkeyAtributeName]]; + } + }); }), esHttp.post(host, port, '/user/profile/_search')(request) .then(function(res){ @@ -184,11 +187,6 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se }) ]) .then(function() { - _.forEach(datas, function(data) { - if (!data.uid && data[pubkeyAtributeName]) { - data.uid = uidsByPubkey[data[pubkeyAtributeName]]; - } - }); if (hits.total === 0) { resolve(datas); } @@ -208,9 +206,6 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se data.avatar=avatar; } data.name=hit._source.title; - if (!data.uid && hit._source.uid) { - data.uid = hit._source.uid; - } if (hit.highlight) { if (hit.highlight.title) { data.name = hit.highlight.title[0]; diff --git a/www/plugins/es/templates/common/view_comments.html b/www/plugins/es/templates/common/view_comments.html index 443e27881c6fd062e3045739467312f7c5ac2d5f..3719bb0e763cb9e515c14a0b9272b655cb49843e 100644 --- a/www/plugins/es/templates/common/view_comments.html +++ b/www/plugins/es/templates/common/view_comments.html @@ -37,7 +37,7 @@ <span class="avatar" ng-style="comment.avatarStyle" ng-class="{'avatar-member': !comment.avatarStyle && comment.uid, 'avatar-wallet': !comment.avatarStyle && !comment.uid}"></span> - {{::comment.message}} + <span ng-bind-html="comment.message"></span> <div class="card-footer text-right gray"> <a class="pull-right" ng-click="shareComment($event, $index)"> <b class="icon ion-android-share-alt"></b>