Updated profile redrawing

This commit is contained in:
Thomas Mathews 2023-01-06 19:11:34 -08:00
parent 608ac1ed04
commit 800d67651b
3 changed files with 5 additions and 23 deletions

View file

@ -170,7 +170,7 @@ function render_reaction_group(model, emoji, reactions, reacting_to) {
if (count > 5)
continue;
const pubkey = reactions[k].pubkey;
str += render_pfp(pubkey, model_get_profile(model, pubkey).data,
str += render_profile_img(model_get_profile(model, pubkey),
{noclick:true});
}
if (count > 5)
@ -287,16 +287,3 @@ function render_profile_img(profile, noclick=false) {
src="${get_profile_pic(profile)}"/>`
}
function render_pfp(pk, profile, opts={}) {
const name = fmt_profile_name(profile, fmt_pubkey(pk));
let str = html`class="pfp clickable" onclick="open_profile('${pk}')"`;
if (opts.noclick)
str = "class='pfp'";
return html`<img
$${str}
data-pubkey="${pk}"
title="${name}"
onerror="this.onerror=null;this.src='${IMG_NO_USER}';"
src="${get_picture(pk, profile)}"/>`
}