From 3042974e55b942d572e05c68db24d724e6d0b903 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Sun, 9 Jun 2024 05:40:37 -0400 Subject: [PATCH] repair file sharing hopefully --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 6f29bed..9626cc0 100644 --- a/app.js +++ b/app.js @@ -338,7 +338,7 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar) { $div.classList.add('message'); const $img = document.createElement('img'); - $img.src = avatar || 'https://via.placeholder.com/40'; + $img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40'; $img.classList.add('avatar'); $div.appendChild($img); @@ -352,13 +352,13 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar) { if (fileType.startsWith('image/')) { const $image = document.createElement('img'); - $image.src = fileUrl; + $image.src = updatePortInUrl(fileUrl); $image.alt = fileName; $image.classList.add('attached-image'); $content.appendChild($image); } else { const $fileLink = document.createElement('a'); - $fileLink.href = fileUrl; + $fileLink.href = updatePortInUrl(fileUrl); $fileLink.textContent = `File: ${fileName}`; $fileLink.download = fileName; $content.appendChild($fileLink);