forked from nostr/nostrweb
profile: fix old profile pic still showing
The profile image never changed until a new one is successfully loaded. This fix clears the picture before loading a new one.
parent
136e66ee94
commit
f26cb737a4
|
@ -147,6 +147,8 @@ function clearProfile() {
|
|||
profileName.textContent = '';
|
||||
profilePubkey.textContent = '';
|
||||
profilePubkeyLabel.hidden = true;
|
||||
profileImage.removeAttribute('src');
|
||||
profileImage.hidden = true;
|
||||
}
|
||||
function renderProfile(evt, relay) {
|
||||
profileContainer.dataset.pubkey = evt.pubkey;
|
||||
|
@ -158,7 +160,8 @@ function renderProfile(evt, relay) {
|
|||
profileName.textContent = content.name;
|
||||
const noxyImg = getNoxyUrl('data', content.picture, evt.id, relay);
|
||||
if (noxyImg) {
|
||||
profileImage.setAttribute('src', getNoxyUrl('data', noxyImg, evt.id, relay))
|
||||
profileImage.setAttribute('src', getNoxyUrl('data', noxyImg, evt.id, relay));
|
||||
profileImage.hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue