From f26cb737a40b15310ff6598b30026ac75ee175d8 Mon Sep 17 00:00:00 2001 From: OFF0 Date: Sun, 18 Dec 2022 23:21:09 +0100 Subject: [PATCH] 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. --- src/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index fab7095..a405e0e 100644 --- a/src/main.js +++ b/src/main.js @@ -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; } } }