web: fix anon users resolving to the same robohash

This commit is contained in:
William Casarin 2022-11-14 17:32:08 -08:00
parent 42fd771333
commit 70d0df5240
3 changed files with 6 additions and 4 deletions

View file

@ -1283,6 +1283,8 @@ function robohash(pk) {
}
function get_picture(pk, profile) {
if (!profile)
return robohash(pk)
if (profile.resolved_picture)
return profile.resolved_picture
profile.resolved_picture = sanitize(profile.picture) || robohash(pk)

View file

@ -162,7 +162,7 @@ function render_event(damus, view, ev, opts={}) {
view.rendered.add(ev.id)
const profile = damus.profiles[ev.pubkey] || DEFAULT_PROFILE
const profile = damus.profiles[ev.pubkey]
const delta = time_delta(new Date().getTime(), ev.created_at*1000)
const has_bot_line = opts.is_reply
@ -229,7 +229,7 @@ function render_reaction_group(model, emoji, reactions, reacting_to) {
}
function render_reaction(model, reaction) {
const profile = model.profiles[reaction.pubkey] || DEFAULT_PROFILE
const profile = model.profiles[reaction.pubkey]
let emoji = reaction.content[0]
if (reaction.content === "+" || reaction.content === "")
emoji = "❤️"