diff --git a/src/main.js b/src/main.js index 5d5baf9..e493330 100644 --- a/src/main.js +++ b/src/main.js @@ -414,9 +414,13 @@ function setMetadata(evt, relay, content) { timestamp: evt.created_at, ...content, }; + // use only the first profile pic (for now), different pics on each releay are not supported yet if (!user.picture) { user.picture = picture; - } // no support (yet) for other picture from same pubkey on different relays + // update profile images + feedContainer.querySelectorAll(`[data-pubkey="${user.pubkey.slice(0, 12)}"]`) + .forEach(img => img.setAttribute('src', picture)); + } } // if (tempContactList[relay]) { // const updates = tempContactList[relay].filter(update => update.pubkey === evt.pubkey); @@ -470,6 +474,7 @@ function getMetadata(evt, relay) { loading: 'lazy', src: userImg, title: `${userName} on ${host} ${userAbout}`, + data: {pubkey: user.pubkey.slice(0, 12)}, }) : elemCanvas(evt.pubkey); const isReply = evt.tags.some(hasEventTag); const replies = replyList.filter((reply) => reply.tags[0][1] === evt.id);