From d1779cb1a7f33933af73d32322ef81a4486772dc Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Sat, 8 Jun 2024 15:32:21 -0400 Subject: [PATCH] Try to fix update peer count --- app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index f010fd2..b51965b 100644 --- a/app.js +++ b/app.js @@ -250,7 +250,7 @@ function onMessageAdded(from, message, avatar) { $div.classList.add('message'); const $img = document.createElement('img'); - $img.src = avatar || 'https://via.placeholder.com/40'; + $img.src = avatar || 'https://via.placeholder.com/40'; // Default to a placeholder image if avatar URL is not provided $div.appendChild($img); const $content = document.createElement('div'); @@ -282,7 +282,9 @@ function truncateHash(hash) { async function updateIcon(username, avatarBuffer) { const userIcon = document.querySelector(`img[src*="${username}.png"]`); if (userIcon) { - userIcon.src = URL.createObjectURL(new Blob([avatarBuffer])); + const servePort = 1337; + const avatarUrl = `http://localhost:${servePort}/icons/${username}.png`; + userIcon.src = avatarUrl; } }